-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.js
47 lines (43 loc) · 945 Bytes
/
main.js
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
/**
* Example implementation of Amazon Simple Email Service (Amazon SES)
*
* @author Maciej Lisowski
* @since 2018-11-25
*/
// import dotenv
require('dotenv').config();
// import AWS SDK
const AWS = require('aws-sdk');
// Amazon SES configuration
const SESConfig = {
apiVersion: '2010-12-01',
accessKeyId: process.env.AWS_SES_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SES_SECRET_ACCESS_KEY,
region: process.env.AWS_SES_REGION
};
var params = {
Source: 'no-reply@t.zulier.com',
Destination: {
ToAddresses: [
'maciej.lisowski.elk@gmail.com'
]
},
ReplyToAddresses: [
'maciej@zulier.com',
],
Message: {
Body: {
Html: {
Charset: "UTF-8",
Data: 'IT IS <strong>WORKING</strong>!'
}
},
Subject: {
Charset: 'UTF-8',
Data: 'Node + SES Example'
}
}
};
new AWS.SES(SESConfig).sendEmail(params).promise().then((res) => {
console.log(res);
});