Skip to content

Instantly share code, notes, and snippets.

@kjbrum
Last active August 29, 2015 14:23
Show Gist options
  • Save kjbrum/7f808024259c01e4eed9 to your computer and use it in GitHub Desktop.
Save kjbrum/7f808024259c01e4eed9 to your computer and use it in GitHub Desktop.
Send an email using Mandrill's API
/**
* Send an email using Mandrill's API
*
* @return {void}
*/
var sendMandrillEmail = function() {
$.ajax({
type: "POST",
url: "https://mandrillapp.com/api/1.0/messages/send.json",
data: {
'key': 'API_KEY',
'message': {
'from_email': '[email protected]',
'to': [
{
'email': '[email protected]',
'name': 'Recipient1 Name (optional)',
'type': 'to'
},
{
'email': '[email protected]',
'name': 'Recipient2 Name (optional)',
'type': 'to'
}
],
'autotext': 'true',
'subject': 'Email Subject',
'html': 'Email content here. You can use HTML.'
}
}
}).done(function(response) {
console.log(response);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment