Skip to content

Commit

Permalink
html email function
Browse files Browse the repository at this point in the history
  • Loading branch information
aletya committed Jul 24, 2024
1 parent b3e1945 commit f7fb2de
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/services/ses/ses-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,30 @@ export function sendEmail(
})
.promise();
}

export function sendHTMLEmail(
emailId: string,
subject: string,
emailHtml: string
): Promise<AWS.SES.SendEmailResponse> {
return ses
.sendEmail({
Destination: {
ToAddresses: [emailId],
},
Message: {
Body: {
Html: {
Data: emailHtml,
},
},
Subject: {
Data: subject,
},
},
Source: Config.OUTGOING_EMAIL_ADDRESSES.Enum[
"[email protected]"
],
})
.promise();
}

0 comments on commit f7fb2de

Please sign in to comment.