Send an html email.
var Mailgun = require('machinepack-mailgun');
// Send an html email.
Mailgun.sendHtmlEmail({
apiKey: 'key-3432afa32e9401482aba183c13f3',
domain: 'sandbox5f89931913a9ab31130131350101.mailgun.og',
toEmail: 'jane@example.com',
toName: 'Jane Doe',
subject: 'Welcome, Jane!',
textMessage: 'Jane,\nThanks for joining our community. If you have any questions, please don\'t hesitate to send them our way. Feel free to reply to this email directly.\n\nSincerely,\nThe Management',
htmlMessage: 'Jane,\nThanks for joining our community. If you have any questions, please don\'t hesitate to send them our way. Feel free to reply to this email directly.\n\nSincerely,\nThe Management',
fromEmail: 'harold@example.enterprise',
fromName: 'Harold Greaseworthy',
}).exec({
// An unexpected error occurred.
error: function (err) {
},
// OK.
success: function () {
},
});
The API key of the Mailgun account to use.
'key-3432afa32e9401482aba183c13f3'
The Mailgun domain to use.
'sandbox5f89931913a9ab31130131350101.mailgun.og'
Email address of the primary recipient.
'jane@example.com'
Full name of the primary recipient.
'Jane Doe'
Subject line for the email.
'Welcome, Jane!'
The plaintext body of the email.
'Jane,\nThanks for joining our community. If you have any questions, please don\'t hesitate to send them our way. Feel free to reply to this email directly.\n\nSincerely,\nThe Management'
The html body of the email.
'Jane,\nThanks for joining our community. If you have any questions, please don\'t hesitate to send them our way. Feel free to reply to this email directly.\n\nSincerely,\nThe Management'
Email address of the sender.
'harold@example.enterprise'
Full name of the sender.
'Harold Greaseworthy'
An unexpected error occurred.
OK.