fix: unawaited emails (#6265)

Await email sending, serverless may end before send

Fixes #6457
This commit is contained in:
Elliot DeNolf
2024-06-12 14:02:05 -04:00
committed by GitHub
parent 4e127054ca
commit 6e55a2e52d
3 changed files with 3 additions and 6 deletions

View File

@@ -129,8 +129,7 @@ export const forgotPasswordOperation = async (incomingArgs: Arguments): Promise<
}) })
} }
// eslint-disable-next-line @typescript-eslint/no-floating-promises await email.sendEmail({
email.sendEmail({
from: `"${email.defaultFromName}" <${email.defaultFromAddress}>`, from: `"${email.defaultFromName}" <${email.defaultFromAddress}>`,
html, html,
subject, subject,

View File

@@ -64,8 +64,7 @@ export async function sendVerificationEmail(args: Args): Promise<void> {
}) })
} }
// eslint-disable-next-line @typescript-eslint/no-floating-promises await email.sendEmail({
email.sendEmail({
from: `"${email.defaultFromName}" <${email.defaultFromAddress}>`, from: `"${email.defaultFromName}" <${email.defaultFromAddress}>`,
html, html,
subject, subject,

View File

@@ -263,8 +263,7 @@ export const createOperation = async <TSlug extends keyof GeneratedTypes['collec
// ///////////////////////////////////// // /////////////////////////////////////
if (collectionConfig.auth && collectionConfig.auth.verify) { if (collectionConfig.auth && collectionConfig.auth.verify) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises await sendVerificationEmail({
sendVerificationEmail({
collection: { config: collectionConfig }, collection: { config: collectionConfig },
config: payload.config, config: payload.config,
disableEmail: disableVerificationEmail, disableEmail: disableVerificationEmail,