- Import emails from a list to a DB

- Create Template Emails
- Options Email
This commit is contained in:
Paolo Arena
2019-12-04 14:07:53 +01:00
parent 6adeb32d46
commit d2dc16b7fb
6 changed files with 444 additions and 2 deletions

View File

@@ -19,6 +19,9 @@ const NewstosentSchema = new Schema({
label: {
type: String,
},
templemail_str: {
type: String,
},
activate: {
type: Boolean,
default: false

View File

@@ -393,7 +393,6 @@ module.exports = {
getdataemail: async (idapp) => {
console.log('getdataemail');
const mydata = {
testomail: await Settings.getValDbSettings(idapp, 'EMAIL_TEXT'),
content_after_events: await Settings.getValDbSettings(idapp, 'TEXT_AFTER_EV'),
mailchimpactive: tools.BoolToInt(await Settings.getValDbSettings(idapp, 'MAILCHIMP_ON')),
urltwitter: await Settings.getValDbSettings(idapp, 'URL_TWITTER'),
@@ -478,6 +477,7 @@ module.exports = {
const mynewsrec = await Newstosent.findOne({ _id: id_newstosent });
mynewsrec.numemail_tot = userstosend.length;
mynewsrec.templemail_str = mylocalsconf.dataemail.templ.subject;
const smtpTransport = this.getTransport();
@@ -502,7 +502,7 @@ module.exports = {
mylocalsconf.emailto = user.email;
mylocalsconf.hashemail = tools.getHash(user.email);
await replacefields(mylocalsconf);
await this.replacefields(mylocalsconf);
// If has already sent, don't send it again!
if (user.lastid_newstosent !== id_newstosent.toString()) {