Home

Awesome

lua-resty-aws-email

Send email using Amazon Simple Email Service(SES) API.

Installation

#luarocks install lua-resty-aws-email

API

:new(aws_email_config)

:send(email, subject, body)
Send email body as text

:send_html(email, subject, body)
send email body as html

Usage

local ses = require 'resty.aws_email'

-- value from amazon simple email service dashboard
local aws_auth_config = {
  aws_key = 'AKIDEXAMPLE',
  aws_secret   = "xxxsecret",
  aws_region   = "us-east-1",  
}

local email = ses:new(aws_auth_config)
local res, err = email:send('hello@world.com', 'hello there', 'Sent using AWS Simple Email Service API') 

if not sent then
  ngx.say('Failed: ' .. err)
else
  ngx.say('Sent')

Todo

References

AWS SES API