Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Used to send Parse Server password reset and email verification emails with Amaz
Read more here: https://github.com/ParsePlatform/parse-server.

## Compatibility
Tested with Parse Server v2.2.13
Last tested with Parse Server v3.10

## Install
```sh
Expand All @@ -23,7 +23,7 @@ var parse=new ParseServer({
from: "Your Name <[email protected]>",
accessKeyId: "Your AWS IAM Access Key ID",
secretAccessKey: "Your AWS IAM Secret Access Key",
region: "Your AWS Region"
awsEndpoint: "AWS end point. Defaults to `https://email.us-east-1.amazonaws.com`"
}
}
});
Expand Down
33 changes: 15 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
var AmazonSES = require("amazon-ses-mailer");
var AmazonSES = require("node-ses");

module.exports=function(options){
module.exports = function (options) {

var ses = new AmazonSES(
options.accessKeyId,
options.secretAccessKey,
options.region
);
var sesClient = AmazonSES.createClient({
key: options.accessKeyId,
secret: options.secretAccessKey,
amazon: options.awsEndpoint,
});

var sendMail=function(mail){
var sendMail = function (mail) {

return new Promise(function(resolve, reject){
return new Promise(function (resolve, reject) {

ses.send({
from: options.from,
sesClient.sendEmail({
to: [mail.to],
from: options.from,
subject: mail.subject,
body: {
text: mail.text
}
}, function(error, data) {

if (error) {
reject(error);
message: mail.text
}, function (err, data) {
if (err) {
reject(err);
} else {
resolve(data);
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse-server-amazon-ses-adapter",
"version": "1.0.0",
"version": "2.0.0",
"description": "Used to send Parse Server password reset and email verification emails with Amazon SES.",
"main": "index.js",
"scripts": {
Expand All @@ -26,6 +26,6 @@
},
"homepage": "https://github.com/collinbrewer/parse-server-amazon-ses-adapter#readme",
"dependencies": {
"amazon-ses-mailer": "^0.2.0"
"node-ses": "^3.0.3"
}
}