Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var nodemailer = require('nodemailer');
- module.exports = function (ctx, done) {
- var transporter = nodemailer.createTransport({
- service: 'gmail',
- auth: {
- user: ctx.data.notifierMailUser,
- pass: ctx.data.notifierMailPassword
- }
- });
- var mailOptions = {
- from: ctx.data.notifierMailUser,
- to: ctx.data.receiverMailUser,
- subject: 'Custom GitHub Notification',
- text: ctx.body ? JSON.stringify(ctx.body, null, 4) : "No information was provided, you should check github"
- };
- transporter.sendMail(mailOptions, function(error, info){
- if (error) {
- done(null, error);
- } else {
- done(null, 'Email sent: ' + info.response);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement