- Import emails from a list to a DB
- Create Template Emails - Options Email
This commit is contained in:
@@ -4,6 +4,8 @@ require('../config/config');
|
||||
|
||||
require('../models/subscribers');
|
||||
|
||||
const CryptoJS = require('crypto-js');
|
||||
|
||||
var Url = require('url-parse');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
@@ -43,6 +45,7 @@ module.exports = {
|
||||
number: 64,
|
||||
typeinrec: 128,
|
||||
multiselect: 256,
|
||||
password: 512,
|
||||
},
|
||||
|
||||
MAX_PHASES: 5,
|
||||
@@ -488,6 +491,33 @@ module.exports = {
|
||||
let mydate = new Date(new Date().getTime() + secs);
|
||||
// console.log('mydate', mydate);
|
||||
return mydate
|
||||
},
|
||||
|
||||
getmd5(mystr) {
|
||||
return CryptoJS.MD5(mystr.toLowerCase()).toString();
|
||||
},
|
||||
|
||||
getHash(mystr) {
|
||||
return CryptoJS.SHA512(mystr, { outputLength: 256 }).toString();
|
||||
},
|
||||
|
||||
cryptdata(mydata) {
|
||||
// Encrypt
|
||||
return CryptoJS.AES.encrypt(JSON.stringify(data), process.env.SECRK);
|
||||
},
|
||||
|
||||
decryptdata(mydatacrypted) {
|
||||
// Decrypt
|
||||
const bytes = CryptoJS.AES.decrypt(mydatacrypted.toString(), process.env.SECRK);
|
||||
return JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
|
||||
},
|
||||
|
||||
BoolToInt(mybool) {
|
||||
return (mybool) ? -1 : 0
|
||||
},
|
||||
|
||||
StrToBool(mystr) {
|
||||
return (mystr === '-1') ? true : false
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -21,6 +21,11 @@ module.exports = Object.freeze({
|
||||
RIS_SUBSCRIBED_ERR: -1,
|
||||
RIS_SUBSCRIBED_STR: 'subscribed',
|
||||
|
||||
RIS_UNSUBSCRIBED_OK: 5,
|
||||
RIS_UNSUBSCRIBED_STR: 'unsubscribed',
|
||||
RIS_UNSUBSCRIBED_NOT_EXIST: -5,
|
||||
RIS_UNSUBSCRIBED_ALREADY_DONE: -10,
|
||||
|
||||
MenuAction: {
|
||||
DELETE: 100,
|
||||
},
|
||||
@@ -47,6 +52,30 @@ module.exports = Object.freeze({
|
||||
de: 'Abonnement des fehlgeschlagenen Newsletters',
|
||||
} ,
|
||||
|
||||
RIS_UNSUBSTR_NOT_EXIST: {
|
||||
enUs: 'Subscription email not found!',
|
||||
es: 'Suscripción email no encontrada!',
|
||||
it: 'Sottoscrizione Email non trovata!',
|
||||
fr: 'Abonnement courriel introuvable!',
|
||||
de: 'E-Mail-Abonnement nicht gefunden!'
|
||||
} ,
|
||||
|
||||
RIS_UNSUB_ERROR_FAILED: {
|
||||
enUs: 'Unsubscribed Failed :(',
|
||||
es: 'Desuscripción al boletín fallido',
|
||||
it: 'Desottoscrizione alla Newsletter Fallita',
|
||||
fr: 'Désabonnement à la newsletter en échec',
|
||||
de: 'Abmeldung des fehlgeschlagenen Newsletters',
|
||||
} ,
|
||||
|
||||
RIS_UNSUBSCRIBED_MSG_ALREADY_DONE: {
|
||||
enUs: 'Unsubscription already made!',
|
||||
es: 'Unsuscripción ya realizada!',
|
||||
it: 'Desottoscrizione già effettuata!',
|
||||
fr: 'Désabonnement déjà fait!',
|
||||
de: 'Abmeldung bereits gemacht!'
|
||||
} ,
|
||||
|
||||
|
||||
LIST_END: '10000000',
|
||||
LIST_START: null,
|
||||
|
||||
Reference in New Issue
Block a user