force subscribe in brevo from notification
This commit is contained in:
@@ -444,6 +444,7 @@ Notifications.sendmail = async (data, tribe) => {
|
||||
};
|
||||
}
|
||||
let confsmtp = conf.smtp;
|
||||
let confbrevoapikey = conf.BREVO.APIKEY;
|
||||
const conftribfile = `../adminapi/objects/tribes/itm/${tribe}.json`;
|
||||
if (fs.existsSync(conftribfile)) {
|
||||
const conftrib = fs.readJSONSync(conftribfile);
|
||||
@@ -458,11 +459,16 @@ Notifications.sendmail = async (data, tribe) => {
|
||||
confsmtp = conftrib.smtp;
|
||||
if (!data.from || data.from == conf.emailcontact)
|
||||
data.from = conftrib.emailcontact;
|
||||
}
|
||||
if (conftrib.BREVO){
|
||||
const toEmails = data.to.split(",");
|
||||
for (const email of toEmails) {
|
||||
await ensureContact(email,conftrib.BREVO.APIKEY);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log("test path:",path.resolve(conftribfile))
|
||||
}
|
||||
|
||||
//console.log(confsmtp);
|
||||
const transporter = await nodemailer.createTransport(confsmtp);
|
||||
if (data.filelist) {
|
||||
|
||||
Reference in New Issue
Block a user