mailer: handle error at the caller instead
the send test email logic breaks if we disable throwing error in send
This commit is contained in:
@@ -75,8 +75,8 @@ async function sendMail(mailOptions) {
|
||||
});
|
||||
|
||||
const [error] = await safe(transport.sendMail(mailOptions));
|
||||
if (error) debug(`Error sending Email "${mailOptions.subject}" to ${mailOptions.to}: ${error.message}`);
|
||||
else debug(`Email "${mailOptions.subject}" sent to ${mailOptions.to}`);
|
||||
if (error) throw new BoxError(BoxError.EXTERNAL_ERROR, `Error sending Email "${mailOptions.subject}" to ${mailOptions.to}: ${error.message}`);
|
||||
debug(`Email "${mailOptions.subject}" sent to ${mailOptions.to}`);
|
||||
}
|
||||
|
||||
function render(templateFile, params, translationAssets) {
|
||||
|
||||
Reference in New Issue
Block a user