Last active
July 23, 2020 18:21
-
-
Save evantahler/a55a2e6b192134faaa90c29157721388 to your computer and use it in GitHub Desktop.
simple sending email service in actionhero
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
var nodemailer = require('nodemailer'); | |
module.exports = { | |
initialize: function(api, next){ | |
api.email = { | |
transporter: nodemailer.createTransport('smtps://user%40gmail.com:[email protected]'), | |
send: function(to, subject, body, callback){ | |
var payload = { | |
from: '"Fred Foo 👥" <[email protected]>', | |
to: to, | |
subject: subject, | |
html: body | |
}; | |
api.email.transporter.sendMail(payload, callback); | |
} | |
}; | |
next(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment