Mandrill.deleteTemplate()

Delete a mandrill template.

Usage

Hover over inputs/exits for more info.

var Mandrill = require('machinepack-mandrill');


// Delete a mandrill template.

Mandrill.deleteTemplate({

apiKey: '1dTOFDXzJdU5cXiMNd6jRq',

name: 'example-template',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

notFound: function (result) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

apiKey required

A valid Mandrill API key.

'1dTOFDXzJdU5cXiMNd6jRq'
name required

The name of an existing template to delete.

'example-template'

Exits

error

An unexpected error occurred.

{ name: 'Mandrill API Error',
  message: 'Oops it didnt work',
  code: 'E_MANDRILL_API' }
notFound
{ status: 'error',
  code: 5,
  name: 'Unknown_Template',
  message: 'No such template "machinepack-mandrill-test"' }
success

OK.

{ slug: 'example-template',
  name: 'Example Template',
  labels: [ 'example-label' ],
  code: '<div mc:edit="editable">editable content</div>',
  subject: 'example subject',
  from_email: 'from.email@example.com',
  from_name: 'Example Name',
  text: 'Example text',
  publish_name: 'Example Template',
  publish_code: '<div mc:edit="editable">different than draft content</div>',
  publish_subject: 'example publish_subject',
  publish_from_email: 'from.email.published@example.com',
  publish_from_name: 'Example Published Name',
  publish_text: 'Example published text',
  published_at: '2013-01-01 15:30:40',
  created_at: '2013-01-01 15:30:27',
  updated_at: '2013-01-01 15:30:49' }