Delete a mandrill template.
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) {
},
});
A valid Mandrill API key.
'1dTOFDXzJdU5cXiMNd6jRq'
The name of an existing template to delete.
'example-template'
An unexpected error occurred.
{
name: 'Mandrill API Error',
message: 'Oops it didnt work',
code: 'E_MANDRILL_API'
}
{
status: 'error',
code: 5,
name: 'Unknown_Template',
message: 'No such template "machinepack-mandrill-test"'
}
OK.
{
slug: 'example-template',
name: 'Example Template',
labels: [ 'example-label' ],
code: '<div mc:edit="editable">editable content</div>',
subject: 'example subject',
from_email: '[email protected]',
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: '[email protected]',
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'
}