Created
October 26, 2017 13:23
-
-
Save mlabouardy/9a12fe80c24bce47862d74995d653109 to your computer and use it in GitHub Desktop.
Send email with MailGun library
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
'use strict'; | |
var mg = require('mailgun-js')({ | |
apiKey: process.env.MAILGUN_API_KEY || 'YOUR_API_KEY', | |
domain: process.env.MAILGUN_DOMAIN || 'DOMAIN_NAME' | |
}); | |
exports.sendEmail = function(event, context, callback){ | |
mg.messages().send({ | |
from: '[email protected]', | |
to: '[email protected]', | |
subject: 'Hello', | |
text: 'Sent from lambda on a defined schedule' | |
}, function(err, body){ | |
callback(err, body) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment