A quick and useful JavaScript application to send emails from your Node.js server.
Amazon AWS SES is a cost-effective, flexible, and scalable email service that enables developers to send mail from within any application.
You may use Windows, macOS, or Linux as your development operating system and the following tools:
Remind: This package was only tested with AWS SES credentials and doesn't support common SMTP connections yet.
This project was built using the following technologies:
This package is compatible with the following templates design:
The following image is an illustration of how the HTML template was handled and compiled with the provided data.
Remind: You can take a look on the templates folder right here.
To add this package to your project, simply execute the following command:
Remind: You must be on your project root directory
$ npm install @kfbfarley/aws-ses-sdk-transport@1.0.3
After installing the package you have to set your environment variables on your .env file located on your root directory
Note: If you don't know what is a .env file, ckeck this article.
AWS_KEY=
AWS_SECRET=
AWS_SERVER=
AWS_SERVER_PORT=
AWS_EMAIL_FROM=
AWS_EMAIL_CHARSET=
TEMPLATE_DIR=./aws/ses/templates/
$ const ses = require("@kfbfarley/aws-ses-sdk-transport")();
Tip: Place your mouse poiter over the your const variable and you will have access to JSDocs
- Send
The method Send(template, receiver) has two parameters, one for template data and another for the receiver data.
If you want to send an email using Amazon Web Service Simple Email Service credentials you should do the following.
Remind: You must have your credentials on your .env file.
const ses = require("@kfbfarley/aws-ses-sdk-transport")();
ses.Send({
name: "confirm",
type: "html"
},{
email: "doe@example.com",
subject: "Hey, Jonh Doe!",
priority: true, // remove to set to normal
first_name: "Jonh",
url: "https://example.com/enable",
url_disable: "https://example.com/disable"
}
);
After the receiver's ISP accpets the email, the ISP decides wheater the email is categorized as span and determines the overall mailbox placement.
There are several factors that can lead to an ISP flagging an email as span, such as:
-
The email content and quality: insecure links, links considered harmful, specific keywords, links to domains that aren't the sending domain
-
DKIM or SPF authentication not provided
-
IP address reputation
-
Multiple emails flagged as spam will put your domain's email into the sandbox
-
High bounce or complaint rates
Setting Up Easy DKIM for a AWS SES domain available here.
Contributions are what make this platform an amazing place to learn, inspire, and create. Please feel free to visit the open issues section to propose or create a related issue.
This repository is MIT licensed, as found in the LICENSE file.
aws-ses-sdk-transport has no documentation, just this repo.