Fix async rendering in email templates

Updated `render` calls to be `await` in account-delete and invite email templates to ensure proper asynchronous operation. Added an empty line in `account-webhooks.service.ts` for code clarity.
This commit is contained in:
gbuomprisco
2024-08-29 11:46:18 +02:00
parent d477a5c7bb
commit 94d0c1607d
3 changed files with 3 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ export async function renderAccountDeleteEmail(props: Props) {
productName: props.productName, productName: props.productName,
}); });
const html = render( const html = await render(
<Html> <Html>
<Head> <Head>
<BodyStyle /> <BodyStyle />

View File

@@ -63,7 +63,7 @@ export async function renderInviteEmail(props: Props) {
teamName: props.teamName, teamName: props.teamName,
}); });
const html = render( const html = await render(
<Html> <Html>
<Head> <Head>
<BodyStyle /> <BodyStyle />

View File

@@ -53,6 +53,7 @@ class AccountWebhooksService {
}) { }) {
const { renderAccountDeleteEmail } = await import('@kit/email-templates'); const { renderAccountDeleteEmail } = await import('@kit/email-templates');
const { getMailer } = await import('@kit/mailers'); const { getMailer } = await import('@kit/mailers');
const mailer = await getMailer(); const mailer = await getMailer();
const { html, subject } = await renderAccountDeleteEmail({ const { html, subject } = await renderAccountDeleteEmail({