Skip to content

Commit

Permalink
fix(mail): using Regex because Docker image doesn't recognize string.…
Browse files Browse the repository at this point in the history
…replaceAll
  • Loading branch information
alu0100966589 committed May 9, 2021
1 parent 966e4fa commit 2262bcb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions utils/mail-sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>', insuranceId)
.replaceAll('<PCRREQUESTID>', pcrRequestId)
.replaceAll('<PCRCONTRACTADDRESS>', pcrContractAddress)
.replaceAll('<NAME>', customerData.customerFullName)
.replaceAll('<EMAIL>', customerData.customerEmail)
.replaceAll('<PHONE>', customerData.customerTelephone)
const emailHtml = mailTemplate
.replace(/\<INSURANCEID\>/g, insuranceId)
.replace(/\<PCRREQUESTID\>/g, pcrRequestId)
.replace(/\<PCRCONTRACTADDRESS\>/g, pcrContractAddress)
.replace(/\<NAME\>/g, customerData.customerFullName)
.replace(/\<EMAIL\>/g, customerData.customerEmail)
.replace(/\<PHONE\>/g, customerData.customerTelephone);

// send email
sendEmail(
Expand Down

0 comments on commit 2262bcb

Please sign in to comment.