fix(server/emails): improve error handling of failed emails (#5390)
This commit is contained in:
@@ -2,7 +2,7 @@ import { emailLogger } from '@/observability/logging'
|
||||
import type { SendEmail, SendEmailParams } from '@/modules/emails/domain/operations'
|
||||
import { getTransporter } from '@/modules/emails/utils/transporter'
|
||||
import { getEmailFromAddress } from '@/modules/shared/helpers/envHelper'
|
||||
import { resolveMixpanelUserId } from '@speckle/shared'
|
||||
import { ensureError, resolveMixpanelUserId } from '@speckle/shared'
|
||||
import {
|
||||
getRequestLogger,
|
||||
loggerWithMaybeContext
|
||||
@@ -68,9 +68,9 @@ export const sendEmail: SendEmail = async ({
|
||||
)
|
||||
return true
|
||||
} catch (error) {
|
||||
logger.error(error)
|
||||
const err = ensureError(error, 'Unknown error when sending email')
|
||||
logger.error(err, 'Error sending email')
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -1284,7 +1284,7 @@
|
||||
},
|
||||
"from": {
|
||||
"type": "string",
|
||||
"description": "The email address from which Speckle will send emails. Defaults to 'no-reply@speckle.systems' if left blank.",
|
||||
"description": "The email address from which Speckle will send emails. If left blank will cause an error when email are sent.",
|
||||
"default": ""
|
||||
},
|
||||
"username": {
|
||||
|
||||
@@ -786,7 +786,7 @@ server:
|
||||
## @param server.email.port The port on the server for the email service.
|
||||
##
|
||||
port: ''
|
||||
## @param server.email.from The email address from which Speckle will send emails. Defaults to 'no-reply@speckle.systems' if left blank.
|
||||
## @param server.email.from The email address from which Speckle will send emails. If left blank will cause an error when email are sent.
|
||||
##
|
||||
from: ''
|
||||
## @param server.email.username The username with which Speckle will authenticate with the email service.
|
||||
|
||||
Reference in New Issue
Block a user