fix(server/emails): improve error handling of failed emails (#5390)

This commit is contained in:
Iain Sproat
2025-09-05 16:14:36 +01:00
committed by GitHub
parent 452e691a7c
commit 36fdde28bb
3 changed files with 5 additions and 5 deletions
@@ -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
}
+1 -1
View File
@@ -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": {
+1 -1
View File
@@ -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.