0.1.0 • Published 8 years ago
@pubsweet/component-aws-ses v0.1.0
AWS SES Configuration
In order to use this component, the following configuration needs to be added to a PubSweet application inside a section named pubsweet-component-aws-ses:
secretAccessKey: theAWS_SES_SECRET_KEYvalue from the app's.envfileaccessKeyId: theAWS_SES_ACCESS_KEYvalue from the app's.envfileregion: theAWS_SES_REGIONvalue from the app's.envfilesender: theEMAIL_SENDERvalue from the app's.envfile
For example:
"pubsweet-component-aws-ses": {
"secretAccessKey": "process.env.AWS_SES_SECRET_KEY",
"accessKeyId": "process.env.AWS_SES_ACCESS_KEY",
"region": "process.env.AWS_SES_REGION",
"sender": "process.env.EMAIL_SENDER",
},In order to use component-aws-ses you first need to have a .env file containing AWS data in the root folder of the starting point of your application.
The .env file contain the following data:
AWS_SES_SECRET_KEY = <secretKey>
AWS_SES_ACCESS_KEY = <accessKey>
EMAIL_SENDER = verified_ses_sender@domain.com
AWS_SES_REGION = region-nameThen, as soon as possible in your app you should add the dotenv package:
require('dotenv').config()component-aws-ses API
A list of endpoints that help you upload, download and delete S3 files.
Send an email POST
Request
POST /api/email
Request body
All parameters are required
{
"email": "to_email@domain.com",
"subject": "Example subject",
"textBody": "this is an email",
"htmlBody": "<p><b>This</b> is an <i>email</i>"
}Response
HTTP/1.1 2040.1.0
8 years ago