Last active
August 29, 2015 14:23
-
-
Save kjbrum/7f808024259c01e4eed9 to your computer and use it in GitHub Desktop.
Send an email using Mandrill's API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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