fix sendEmail

This commit is contained in:
m5r
2021-10-31 16:16:29 +01:00
parent c398484cf8
commit 064be8e2a6
3 changed files with 13 additions and 13 deletions

View File

@ -22,12 +22,6 @@ export async function sendEmail({ text, html, subject, recipients }: SendEmailPa
Destination: { ToAddresses: recipients },
Message: {
Body: {
Text: text
? {
Charset: "UTF-8",
Data: text,
}
: undefined,
Html: {
Charset: "UTF-8",
Data: html,
@ -41,5 +35,12 @@ export async function sendEmail({ text, html, subject, recipients }: SendEmailPa
Source: serverRuntimeConfig.awsSes.fromEmail,
};
if (text) {
request.Message.Body.Text = {
Charset: "UTF-8",
Data: text,
};
}
await ses.sendEmail(request).promise();
}