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 confsmtp = conf.smtp;
|
||||||
|
let confbrevoapikey = conf.BREVO.APIKEY;
|
||||||
const conftribfile = `../adminapi/objects/tribes/itm/${tribe}.json`;
|
const conftribfile = `../adminapi/objects/tribes/itm/${tribe}.json`;
|
||||||
if (fs.existsSync(conftribfile)) {
|
if (fs.existsSync(conftribfile)) {
|
||||||
const conftrib = fs.readJSONSync(conftribfile);
|
const conftrib = fs.readJSONSync(conftribfile);
|
||||||
@@ -458,11 +459,16 @@ Notifications.sendmail = async (data, tribe) => {
|
|||||||
confsmtp = conftrib.smtp;
|
confsmtp = conftrib.smtp;
|
||||||
if (!data.from || data.from == conf.emailcontact)
|
if (!data.from || data.from == conf.emailcontact)
|
||||||
data.from = conftrib.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))
|
||||||
}
|
}
|
||||||
const toEmails = data.to.split(",");
|
|
||||||
for (const email of toEmails) {
|
|
||||||
await ensureContact(email,conftrib.BREVO.APIKEY);
|
|
||||||
}
|
|
||||||
//console.log(confsmtp);
|
//console.log(confsmtp);
|
||||||
const transporter = await nodemailer.createTransport(confsmtp);
|
const transporter = await nodemailer.createTransport(confsmtp);
|
||||||
if (data.filelist) {
|
if (data.filelist) {
|
||||||
|
|||||||
Reference in New Issue
Block a user