feat: Adding redirect test emails list
This commit is contained in:
@@ -17,9 +17,16 @@ const transporter = nodemailer.createTransport(
|
||||
|
||||
async function sendMailTemplate( templateId, receiver, subject, content ){
|
||||
/**TODO: Remove in production */
|
||||
const default_mail = "testing@etaviaporte.com"
|
||||
if( receiver.indexOf( default_mail ) >= 0 ){
|
||||
receiver = default_mail;
|
||||
const default_mail_list = [
|
||||
{pattern:"testing@etaviaporte.com",redirect:"testing@etaviaporte.com"},
|
||||
{pattern:"alex@etaviaporte.com",redirect:"alexandro_uribe@outlook.com"},
|
||||
{pattern:"pablo@etaviaporte.com",redirect:"josepablo134@gmail.com"}
|
||||
];
|
||||
for( let i=0; i< default_mail_list.length; i++ ){
|
||||
if( receiver.indexOf( default_mail_list[i].pattern ) >= 0 ){
|
||||
receiver = default_mail_list[i].redirect;
|
||||
break;/** Set only the first match */
|
||||
}
|
||||
}
|
||||
return await transporter.sendMail({
|
||||
from: sendgridConfig.FROM,
|
||||
|
||||
Reference in New Issue
Block a user