ag-common 0.0.704 → 0.0.705
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/helpers/ses.js +9 -3
- package/package.json +1 -1
package/dist/api/helpers/ses.js
CHANGED
|
@@ -27,18 +27,24 @@ const sendEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ to, messa
|
|
|
27
27
|
(0, log_1.warn)('ses arn not equal to config region changing to:' + sourceArnRegion);
|
|
28
28
|
(0, exports.setSes)(sourceArnRegion);
|
|
29
29
|
}
|
|
30
|
+
const ishtml = message.startsWith('<!DOCTYPE HTML') || message.startsWith('<html');
|
|
30
31
|
yield exports.ses.send(new client_ses_1.SendEmailCommand({
|
|
31
32
|
Destination: {
|
|
32
33
|
CcAddresses: [],
|
|
33
34
|
ToAddresses: [to],
|
|
34
35
|
},
|
|
35
36
|
Message: {
|
|
36
|
-
Body: {
|
|
37
|
-
|
|
37
|
+
Body: Object.assign(Object.assign({}, (ishtml && {
|
|
38
|
+
Html: {
|
|
39
|
+
Data: message,
|
|
38
40
|
Charset: 'UTF-8',
|
|
41
|
+
},
|
|
42
|
+
})), (!ishtml && {
|
|
43
|
+
Text: {
|
|
39
44
|
Data: message,
|
|
45
|
+
Charset: 'UTF-8',
|
|
40
46
|
},
|
|
41
|
-
},
|
|
47
|
+
})),
|
|
42
48
|
Subject: {
|
|
43
49
|
Charset: 'UTF-8',
|
|
44
50
|
Data: subject,
|
package/package.json
CHANGED