Skip to content

Instantly share code, notes, and snippets.

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 AaronMcCaughan/d83c6e6f10e4e42558d766abc1682903 to your computer and use it in GitHub Desktop.
Save AaronMcCaughan/d83c6e6f10e4e42558d766abc1682903 to your computer and use it in GitHub Desktop.
Sample script to trigger email notifications
let run = function (args) {
return new Promise((resolve,reject)=>{
console.log('Sending email');
mailData = {
to: 'email@email.com', // Required - Address data can be passed as a single string with commmas separating addresses or an array of single address strings. ie: ['a@a.com', 'b@b.com']
//cc: 'a@a.com', //optional
//bcc: 'a@a.com', //optional
subject: 'Test Email', //Required
body: 'This email was sent from a script. <b> Bold Text </b> <i>Italicized text</i>', //Required - This accepts HTML or standard text input.
signature: '\n\n\nRegards\n John Smith' //Optional. If excluded a default Plutora signature will be appended.
};
mailer.send(mailData)
.then(response => {
resolve(console.log('Email sent successfully.\n' + response));
})
.catch(error => {
reject(console.log('Failed to send email.\n' + error));
});
});
};
module.exports = {
run: run
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment