Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paragasu/lua-resty-aws-email
Send email using Amazon Simple Email Service (SES) API.
https://github.com/paragasu/lua-resty-aws-email
Last synced: 2 months ago
JSON representation
Send email using Amazon Simple Email Service (SES) API.
- Host: GitHub
- URL: https://github.com/paragasu/lua-resty-aws-email
- Owner: paragasu
- License: mit
- Created: 2016-08-09T07:03:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-12T07:21:42.000Z (over 5 years ago)
- Last Synced: 2024-08-03T18:13:09.625Z (6 months ago)
- Language: Lua
- Size: 23.4 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-resty - lua-resty-aws-email
README
# lua-resty-aws-email
Send email using Amazon Simple Email Service(SES) API.# Installation
```lua
#luarocks install lua-resty-aws-email
```# API
**:new(aws_email_config)**
- @param table with
- aws_key from aws dashboard
- aws_secret from aws dashboard
- aws_region aws_region is where the SES account created**:send(email, subject, body)**
Send email body as text
- @param email string recipient email
- @param subject string email subject
- @param body string email content**:send_html(email, subject, body)**
send email body as html
- @param email string recipient email
- @param subject string email subject
- @param body string email content# Usage
```lua
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('[email protected]', 'hello there', 'Sent using AWS Simple Email Service API')if not sent then
ngx.say('Failed: ' .. err)
else
ngx.say('Sent')
```# Todo
- Add support for file attachment# References
[AWS SES API](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/query-interface-requests.html)