use maizzle for email templating, starting with reset password email

This commit is contained in:
m5r
2021-10-26 23:34:21 +02:00
parent 3f279634b6
commit 514dae3ebb
25 changed files with 6069 additions and 508 deletions

View File

@ -11,19 +11,24 @@ const credentials = new Credentials({
const ses = new SES({ region: serverRuntimeConfig.awsSes.awsRegion, credentials });
type SendEmailParams = {
body: string;
text: string;
html: string;
subject: string;
recipients: string[];
};
export async function sendEmail({ body, subject, recipients }: SendEmailParams) {
export async function sendEmail({ text, html, subject, recipients }: SendEmailParams) {
const request: SendEmailRequest = {
Destination: { ToAddresses: recipients },
Message: {
Body: {
Text: {
Charset: "UTF-8",
Data: body,
Data: text,
},
Html: {
Charset: "UTF-8",
Data: html,
},
},
Subject: {