All Projects → craftzdog → send-email-lambda

craftzdog / send-email-lambda

Licence: MIT license
Simple email sender running on Lambda

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to send-email-lambda

apex-api-gateway-boilerplate
Boilerplate for AWS Lambda and API Gateway using Apex
Stars: ✭ 19 (-72.86%)
Mutual labels:  api-gateway, apex
R.apex
Functional utility library for Apex
Stars: ✭ 80 (+14.29%)
Mutual labels:  apex
ses-email-client
Simple, serverless client for AWS SES. With this, you can send/read emails received by SES into S3 without purchasing AWS Workmail. If you only use SES for email marketing, you can also see and preview your SES templates in the browser
Stars: ✭ 21 (-70%)
Mutual labels:  aws-ses
aws-lambda-router
Improved routing for AWS Lambda like SNS and ApiGateway
Stars: ✭ 90 (+28.57%)
Mutual labels:  api-gateway
lambda-multipart-parser
This nodejs module will parse the multipart-form containing files and fields from the AWS lambda event object. It works very well parsing binary and text files.
Stars: ✭ 45 (-35.71%)
Mutual labels:  api-gateway
serverless-node-sequelize-rds-rest-api
Serverless rest api application with Node.js to perform simple CRUD operation using MYSQL database hosted on AWS RDS with Sequelize ORM
Stars: ✭ 43 (-38.57%)
Mutual labels:  api-gateway
spacesuit
API Gateway with URL remapping
Stars: ✭ 19 (-72.86%)
Mutual labels:  api-gateway
apex-tmLanguage
Salesforce Apex Language syntax grammar used for colorization
Stars: ✭ 27 (-61.43%)
Mutual labels:  apex
ApexCallouts
A lightweight Apex library for making HTTP callouts. Works with remote site settings and named credentials.
Stars: ✭ 32 (-54.29%)
Mutual labels:  apex
lmdrouter
Go HTTP router library for AWS API Gateway-invoked Lambda Functions
Stars: ✭ 121 (+72.86%)
Mutual labels:  api-gateway
ApeX
Using Social Engineering To Obtain WiFi Passwords
Stars: ✭ 87 (+24.29%)
Mutual labels:  apex
lambda-mailer
Simple module for receiving an email from a contact form on your website.
Stars: ✭ 83 (+18.57%)
Mutual labels:  aws-ses
lambda-starter
AWS Lambda Starter Kit with latest Babel 7, Jest 24 and Webpack 4.
Stars: ✭ 26 (-62.86%)
Mutual labels:  api-gateway
sfdc-error-playground
Lightning & Apex Error Playground
Stars: ✭ 30 (-57.14%)
Mutual labels:  apex
apex-plugin-spotlight
Oracle APEX Dynamic Action Plugin - APEX Spotlight Search
Stars: ✭ 20 (-71.43%)
Mutual labels:  apex
apex-rest-route
A simple framework for building Restful API on Salesforce
Stars: ✭ 75 (+7.14%)
Mutual labels:  apex
timeline-component-lwc
This component enables timeline view for Salesforce Record history.
Stars: ✭ 18 (-74.29%)
Mutual labels:  apex
EnhancedLightningGrid
Component that allows you to sort and filter data within the Lightning Experience. Use as a replacement for a Related List, or create a new grid that shows results from a custom query.
Stars: ✭ 110 (+57.14%)
Mutual labels:  apex
proto2gql
The project has been migrated to https://github.com/EGT-Ukraine/go2gql.
Stars: ✭ 21 (-70%)
Mutual labels:  api-gateway
Helmet
🐺 A Lightweight Cloud Native API Gateway.
Stars: ✭ 124 (+77.14%)
Mutual labels:  api-gateway

send-email-lambda

Simple email sender running on Lambda. It sends emails via AWS SES. It comes in handy when you would add a contact form to your static website.

Prerequisites

Prepare

Init your project

git clone [email protected]:craftzdog/send-email-lambda.git
cd send-email-lambda
apex init
> Project nane: send-email

Edit your project.json file based on project.json.example like:

{
  "name": "send-email",
  "description": "Simple email transmitter",
  "memory": 128,
  "timeout": 5,
  "environment": {},
  "runtime": "nodejs6.10",
  "role": "<YOUR_IAM_ROLE>"
}

Configure

Edit functions/submit/function.json as you like:

{
  "environment": {
    "SES_REGION": "us-west-2",
    "FROM_NAME": "Craftzdog Contact Form",
    "FROM_EMAIL": "<YOUR_AUTOMATED_EMAIL_SENDER>",
    "TO_EMAIL": "<EMAIL_TO_RECEIVE>"
  }
}
  • SES_REGION: The AWS region for the SES
  • FROM_NAME: Sender name like "Contact Form"
  • FROM_EMAIL: The email address you would receive from. e.g., [email protected]
  • TO_EMAIL: Your personal email address to receive emails.

Add a permission to send emails to the IAM role

Add following policy to your lambda's IAM role (ex. send-email_lambda_function) that allows the lambda function to use SES.sendEmail with policy name send-email_submit:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1504526549000",
            "Effect": "Allow",
            "Action": [
                "ses:SendEmail"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}

Deploy and test sending emails

At the project top directory:

apex deploy

You can run the lambda function manually with below command:

echo -n '{ "subject": "hello", "body": "world" }' | apex invoke submit

And you will get an email to the configured address.

Publish on the Web

API Gateway

Configure your API Gateway like this:

API Gateway

And deploy the API.

Swagger definitions

See the swagger YAML file as an example.

API

POST <YOUR_API_ENTRYPOINT>/submit

It accepts JSON data with 2 fields:

  • subject: The message subject
  • body: The message body

License

MIT, Copyright 2017 by Takuya Matsuyama <[email protected]>

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].