- Import emails from a list to a DB
- Create Template Emails - Options Email
This commit is contained in:
@@ -19,6 +19,9 @@ const NewstosentSchema = new Schema({
|
||||
label: {
|
||||
type: String,
|
||||
},
|
||||
templemail_str: {
|
||||
type: String,
|
||||
},
|
||||
activate: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user