fix sendEmail
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user