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:
@@ -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 />
|
||||||
|
|||||||
@@ -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 />
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user