change with test-mode = on the email-receiver to EMAIL_TEST_RECEIVER

This commit is contained in:
Claus-Peter Hübner 2022-09-16 16:53:35 +02:00
parent 4f97999195
commit f9194beca3

View File

@ -19,6 +19,12 @@ export const sendEMail = async (emailDef: {
logger.info(`Emails are disabled via config...`) logger.info(`Emails are disabled via config...`)
return false return false
} }
if (CONFIG.TEST_MODUS) {
logger.info(
`Testmodus=ON: change receiver from ${emailDef.to} to ${CONFIG.EMAIL_TEST_RECEIVER}`,
)
emailDef.to = CONFIG.EMAIL_TEST_RECEIVER
}
const transporter = createTransport({ const transporter = createTransport({
host: CONFIG.EMAIL_SMTP_URL, host: CONFIG.EMAIL_SMTP_URL,
port: Number(CONFIG.EMAIL_SMTP_PORT), port: Number(CONFIG.EMAIL_SMTP_PORT),