-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
55 lines (34 loc) · 1.58 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
bsh-aws-ses-send provides basic capability to send an email using SES. Credentials can either be passed in (not recommend) or set per ASWS documentation in environment variables or in the credentials file.
=====
install: npm install bsh-aws-ses-send
=====
usage:
var sendEmail = require ('bsh-aws-ses-send')(region, credentialsProfile, accessKeys);
WHERE:
sendEmail is a function that returns a Promise
region = AWS region (string) - required
credentialsProfile = AWS profile in the AWS credentials file - optional
accessKeys = {accessKeyId: 'your access key', secretAccessKey: 'your secret access key'} - optional
If you don't provide credentialsProfile or accessKeys, the module will attempt to load access keys from
the environment using AWS environment parameters:
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
OR
AMAZON_ACCESS_KEY_ID AMAZON_SECRET_ACCESS_KEY
The returned Promise's success value is the AWS return object, which is often of little interest.
The returned Promise's failure value is either a validation Error or an AWS error object
=====
Invoke sendMail as follows:
sendMail(email).then(function(successVal) {
// Success code
}, function(errorVal) {
// Error code
});
WHERE:
var email = {from:'from email address', // required
toAddresses: ['toAddress1','toAddress2'], // optional
ccAddresses: ['toAddress1','toAddress2'], // optional
bccAddresses: ['toAddress1','toAddress2'], // optional
subject: 'subject', // required
textBody: 'textBody', // optional
htmlBody: 'htmlBody' // optional
};