Small simple AWS lambda REST microservice that send email via Gmail
git clone https://github.com/skojin/send-gmail-lambda.git
cd send-gmail-lambda
npm install
bundle install
cp config.rb.example config.rb
Get gmail oauth credential using this guide, and save them to config.rb
Deploy to AWS lambda with Serverless Framework
serverless deploy
Remember endpoint URL from deploy command output
# ruby
Net::HTTP.post_form(
URI("https://XXX.execute-api.us-east-1.amazonaws.com/dev/send/some-random-secure-key"),
{to: "[email protected]", subject: 'SUBJECT' body: 'TEXT BODY'})
curl -X POST "https://XXX.execute-api.us-east-1.amazonaws.com/dev/send/some-random-secure-key" -d "subject=SUBJECT&body=BODY&[email protected]"