fix: unawaited emails (#6265)
Await email sending, serverless may end before send Fixes #6457
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user