Disabled email sending, if no mail server is configured.

This commit is contained in:
Adrian Winterstein 2024-09-28 16:23:15 +02:00
parent 5e845b8aa6
commit 98c99d906e
No known key found for this signature in database
GPG key ID: EDBA4B9F8D8E37AE

View file

@ -156,6 +156,11 @@ export async function sendTxn (mailingInfoArray, emailType, variables, personalV
}
if (IS_PROD && mailingInfoArray.length > 0) {
if (EMAIL_SERVER.url === undefined || EMAIL_SERVER.url === '') {
logger.info('Will not send email, because there is no mail server configured.');
return null;
}
return got.post(`${EMAIL_SERVER.url}/job`, {
retry: 5, // retry the http request to the email server 5 times
timeout: 60000, // wait up to 60s before timing out