Skip to content

Instantly share code, notes, and snippets.

@ardrian
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ardrian/dcb47afeb59cad0234eb to your computer and use it in GitHub Desktop.
Save ardrian/dcb47afeb59cad0234eb to your computer and use it in GitHub Desktop.
Parse.com Mandrill Send with Promise
// This method sends an email via Mandrill. It returns a promise chain
// so that it can be more neatly included as part of a promise chain.
var sendMandrillEmailPromise = function(message,send_at){
var promise = new Parse.Promise();
Mandrill.sendEmail({
message: message,
async: true,
send_at: send_at
},{
success: function(httpResponse) {
promise.resolve(httpResponse);
},
error: function(error) {
promise.error(error);
}
});
return promise;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment