From 2262bcb7426776fdfb974854f972861005b1eef8 Mon Sep 17 00:00:00 2001 From: krl Date: Sun, 9 May 2021 23:33:10 +0100 Subject: [PATCH] fix(mail): using Regex because Docker image doesn't recognize string.replaceAll --- utils/mail-sender.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/utils/mail-sender.js b/utils/mail-sender.js index 514343a..125de87 100644 --- a/utils/mail-sender.js +++ b/utils/mail-sender.js @@ -56,12 +56,13 @@ function sendEmailToLaboratory(insuranceId, pcrRequestId, pcrContractAddress, cu emailText += `Los datos del cliente son los siguientes:\n - Nombre: ${customerData.customerFullName}\n - Teléfono: ${customerData.customerTelephone}\n - Email: ${customerData.customerEmail}` } - const emailHtml = mailTemplate.replaceAll('', insuranceId) - .replaceAll('', pcrRequestId) - .replaceAll('', pcrContractAddress) - .replaceAll('', customerData.customerFullName) - .replaceAll('', customerData.customerEmail) - .replaceAll('', customerData.customerTelephone) + const emailHtml = mailTemplate + .replace(/\/g, insuranceId) + .replace(/\/g, pcrRequestId) + .replace(/\/g, pcrContractAddress) + .replace(/\/g, customerData.customerFullName) + .replace(/\/g, customerData.customerEmail) + .replace(/\/g, customerData.customerTelephone); // send email sendEmail(