Built motion from commit 94df3a359.|1.0.33
[motion.git] / server / config / smtp / smtp.js
index 7c123f1..ac6c2b3 100644 (file)
@@ -1 +1 @@
-var _0xd452=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x6D\x75\x73\x74\x61\x63\x68\x65","\x6D\x61\x69\x6C","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72\x2D\x73\x6D\x74\x70\x2D\x74\x72\x61\x6E\x73\x70\x6F\x72\x74","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x72\x70\x63\x2F\x63\x6C\x69\x65\x6E\x74","\x65\x72\x72\x6F\x72","\x53\x4D\x54\x50\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x25\x73\x20\x45\x52\x52\x4F\x52","\x61\x72\x67\x76","\x66\x6F\x72\x6D\x61\x74","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x58\x49\x54\x45\x44\x20\x57\x49\x54\x48\x20\x43\x4F\x44\x45\x20\x25\x73","\x69\x6E\x66\x6F","\x6D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x73\x74\x61\x74\x65","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x43\x4F\x4E\x4E\x45\x43\x54\x49\x4E\x47","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x54\x41\x52\x54\x49\x4E\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x70\x69\x64","\x67\x63","\x47\x61\x72\x62\x61\x67\x65\x20\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x20\x75\x6E\x61\x76\x61\x69\x6C\x61\x62\x6C\x65\x2E\x20\x20\x50\x61\x73\x73\x20\x2D\x2D\x65\x78\x70\x6F\x73\x65\x2D\x67\x63\x20","\x77\x68\x65\x6E\x20\x6C\x61\x75\x6E\x63\x68\x69\x6E\x67\x20\x6E\x6F\x64\x65\x20\x74\x6F\x20\x65\x6E\x61\x62\x6C\x65\x20\x66\x6F\x72\x63\x65\x64\x20\x67\x61\x72\x62\x61\x67\x65\x20\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x2E","\x77\x61\x72\x6E","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x52\x52\x4F\x52\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x74\x61\x63\x6B","\x45\x52\x52\x4F\x52","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x73\x65\x6E\x64","\x63\x61\x74\x63\x68","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x74\x68\x65\x6E","\x76\x65\x72\x69\x66\x79","\x68\x6F\x73\x74","\x70\x6F\x72\x74","\x73\x73\x6C","\x70\x61\x73\x73\x77\x6F\x72\x64","\x63\x72\x65\x61\x74\x65\x54\x72\x61\x6E\x73\x70\x6F\x72\x74","\x6D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x6D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74\x49\x64","\x69\x64","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x45\x4E\x44\x49\x4E\x47\x20\x4D\x53\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x74\x61\x74\x75\x73","\x53\x45\x4E\x44\x49\x4E\x47","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x5B\x53\x4D\x54\x50\x5D\x20\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x25\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x75\x70\x64\x61\x74\x65","\x46\x41\x49\x4C\x45\x44","\x72\x65\x74\x72\x79\x53\x65\x6E\x64","\x6D\x65\x73\x73\x61\x67\x65\x49\x64","\x53\x45\x4E\x54","\x68\x74\x6D\x6C","\x75\x74\x66\x38","\x74\x65\x78\x74","\x74\x6F","\x69\x73\x41\x72\x72\x61\x79","\x61\x64\x64\x72\x65\x73\x73","\x77\x69\x74\x68\x6F\x75\x74","\x3B","\x73\x70\x6C\x69\x74","\x63\x63","\x62\x63\x63","\x73\x75\x62\x6A\x65\x63\x74","\x6E\x61\x6D\x65","\x66\x72\x6F\x6D","\x6A\x6F\x69\x6E","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x72\x65\x6E\x64\x65\x72","\x54\x65\x6D\x70\x6C\x61\x74\x65","\x61\x75\x74\x6F","","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x77\x68\x69\x74\x65\x4C\x61\x62\x65\x6C","\x3C\x62\x72\x3E","\x3C\x62\x72\x3E\x20\x53\x65\x6E\x74\x20\x77\x69\x74\x68\x20\x58\x43\x41\x4C\x4C\x59\xAE","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x70\x61\x74\x68","\x6D\x61\x70","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x55\x73\x65\x72\x48\x61\x73\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x72\x65\x71\x75\x65\x73\x74","\x73\x68\x6F\x77","\x55\x73\x65\x72","\x55\x73\x65\x72\x49\x64","\x6C\x65\x6E\x67\x74\x68","\x6D\x61\x69\x6C\x4F\x75\x74","\x50\x45\x4E\x44\x49\x4E\x47","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x5C\x6E","\x5C\x6E\x20\x53\x65\x6E\x74\x20\x77\x69\x74\x68\x20\x58\x43\x41\x4C\x4C\x59\xAE","\x63\x72\x65\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74"];_0xd452[0];var util=require(_0xd452[1]);var _=require(_0xd452[2]);var moment=require(_0xd452[3]);var Mustache=require(_0xd452[4]);var logger=require(_0xd452[6])(_0xd452[5]);var nodemailer=require(_0xd452[7]);var smtpTransport=require(_0xd452[8]);var htmlToText=require(_0xd452[9]);var rpcClient=require(_0xd452[10]);var smtp;process[_0xd452[15]](_0xd452[19],function(_0x1785xd){if(_0x1785xd[_0xd452[20]]=== _0xd452[19]){onSend(_0x1785xd)};if(_0x1785xd[_0xd452[20]]=== _0xd452[21]){switch(_0x1785xd[_0xd452[21]]){case _0xd452[23]:onVerify(_0x1785xd[_0xd452[22]]);break;default:}}})[_0xd452[15]](_0xd452[16],function(_0x1785xc){logger[_0xd452[18]](util[_0xd452[14]](_0xd452[17],process[_0xd452[13]][3],_0x1785xc))})[_0xd452[15]](_0xd452[11],function(_0x1785xb){logger[_0xd452[11]](util[_0xd452[14]](_0xd452[12],process[_0xd452[13]][3]),_0x1785xb)});logger[_0xd452[18]](util[_0xd452[14]](_0xd452[24],process[_0xd452[13]][3],process[_0xd452[25]]));setInterval(function(){if(global[_0xd452[26]]){global[_0xd452[26]]()}else {logger[_0xd452[29]](_0xd452[27]+ _0xd452[28])}},20000);function onVerify(_0x1785xf){smtp[_0xd452[39]]()[_0xd452[38]](function(){logger[_0xd452[18]](util[_0xd452[14]](_0xd452[36],_0x1785xf,process[_0xd452[25]]));process[_0xd452[34]]({type:_0xd452[21],state:_0xd452[37],source:null})})[_0xd452[35]](function(_0x1785xb){logger[_0xd452[11]](util[_0xd452[14]](_0xd452[30],_0x1785xf,process[_0xd452[25]]),_0x1785xb[_0xd452[31]]);process[_0xd452[34]]({type:_0xd452[21],state:_0xd452[32],source:JSON[_0xd452[33]](_0x1785xb)})})}function onSave(_0x1785x11){smtp= nodemailer[_0xd452[44]](smtpTransport({host:_0x1785x11[_0xd452[40]],port:_0x1785x11[_0xd452[41]],secure:_0x1785x11[_0xd452[42]],pool:true,auth:{user:_0x1785x11[_0xd452[22]],pass:_0x1785x11[_0xd452[43]]}}));smtp[_0xd452[45]]= _0x1785x11[_0xd452[46]];smtp[_0xd452[47]]= _0x1785x11[_0xd452[48]];smtp[_0xd452[22]]= _0x1785x11[_0xd452[22]];onVerify(_0x1785x11[_0xd452[22]])}function onSend(_0x1785x13){logger[_0xd452[18]](util[_0xd452[14]](_0xd452[49],process[_0xd452[13]][3],process[_0xd452[25]]));if(_0x1785x13[_0xd452[50]]=== _0xd452[51]){var _0x1785x14;var _0x1785x15;var _0x1785x16;var _0x1785x17=_0x1785x13;var _0x1785x18,_0x1785x19,_0x1785x1a,_0x1785x1b;var _0x1785x1c,_0x1785x1d;if(_0x1785x17[_0xd452[52]]){return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[100],{where:{id:_0x1785x17[_0xd452[54]]}}])[_0xd452[38]](function(_0x1785x27){_0x1785x14= _0x1785x27;return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[102],{where:{id:_0x1785x27[_0xd452[46]]},include:[{model:_0xd452[79]}]}])})[_0xd452[38]](function(_0x1785x26){_0x1785x15= _0x1785x26;return rpcClient[_0xd452[93]](_0xd452[55],[_0xd452[101],{MailRoomId:_0x1785x14[_0xd452[48]]},{where:{id:_0x1785x17[_0xd452[48]]}}])})[_0xd452[38]](function(){var _0x1785xd={lastEvent:_0xd452[51],attachment:_0x1785x17[_0xd452[86]]&& _0x1785x17[_0xd452[86]][_0xd452[97]],mailOut:++_0x1785x14[_0xd452[98]]};if(!_0x1785x13[_0xd452[80]]){_0x1785xd[_0xd452[50]]= _0xd452[99]};return rpcClient[_0xd452[93]](_0xd452[55],[_0xd452[100],_0x1785xd,{where:{id:_0x1785x14[_0xd452[48]]}}])})[_0xd452[38]](function(){return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[95],{where:{id:_0x1785x17[_0xd452[96]]}}])})[_0xd452[38]](function(_0x1785x25){_0x1785x16= _0x1785x25;return rpcClient[_0xd452[93]](_0xd452[91],[_0xd452[92],{where:{UserId:_0x1785x16[_0xd452[48]],MailRoomId:_0x1785x14[_0xd452[48]]},defaults:{UserId:_0x1785x16[_0xd452[48]],MailRoomId:_0x1785x14[_0xd452[48]]}}])})[_0xd452[38]](function(_0x1785x1f){_0x1785x17[_0xd452[60]]= _0x1785x17[_0xd452[60]]?_0x1785x17[_0xd452[60]].toString(_0xd452[61]):null;_0x1785x17[_0xd452[62]]= _0x1785x17[_0xd452[62]]?_0x1785x17[_0xd452[62]].toString(_0xd452[61]):null;var _0x1785x20=_0x1785x17[_0xd452[63]]?_[_0xd452[64]](_0x1785x17[_0xd452[63]])?_[_0xd452[66]](_0x1785x17[_0xd452[63]],_0x1785x15[_0xd452[65]]):_[_0xd452[66]](_0x1785x17[_0xd452[63]][_0xd452[68]](_0xd452[67]),_0x1785x15[_0xd452[65]]):[];var _0x1785x21=_0x1785x17[_0xd452[69]]?(_[_0xd452[64]](_0x1785x17[_0xd452[69]])?_[_0xd452[66]](_0x1785x17[_0xd452[69]],_0x1785x15[_0xd452[65]]):_[_0xd452[66]](_0x1785x17[_0xd452[69]][_0xd452[68]](_0xd452[67]),_0x1785x15[_0xd452[65]])):[];var _0x1785x22=_0x1785x17[_0xd452[70]]?_[_0xd452[64]](_0x1785x17[_0xd452[70]])?_[_0xd452[66]](_0x1785x17[_0xd452[70]],_0x1785x15[_0xd452[65]]):_[_0xd452[66]](_0x1785x17[_0xd452[70]][_0xd452[68]](_0xd452[67]),_0x1785x15[_0xd452[65]]):[];if(_0x1785x17[_0xd452[71]]){_0x1785x17[_0xd452[71]]= Mustache[_0xd452[78]](_0x1785x17[_0xd452[71]],{interactionId:_0x1785x14[_0xd452[48]],accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};if(_0x1785x15[_0xd452[79]]&& _0x1785x15[_0xd452[79]][_0xd452[71]]&&  !_0x1785x13[_0xd452[80]]){_0x1785x15[_0xd452[79]][_0xd452[71]]= Mustache[_0xd452[78]](_0x1785x15[_0xd452[79]][_0xd452[71]],{interactionId:_0x1785x14[_0xd452[48]],accountName:_0x1785x15[_0xd452[72]],subject:_0x1785x17[_0xd452[71]]|| _0xd452[81],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};if(_0x1785x17[_0xd452[60]]){_0x1785x17[_0xd452[60]]= Mustache[_0xd452[78]](_0x1785x17[_0xd452[60]],{interactionId:_0x1785x14[_0xd452[48]],subject:_0x1785x17[_0xd452[71]],accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};if(_0x1785x17[_0xd452[62]]){_0x1785x17[_0xd452[62]]= Mustache[_0xd452[78]](_0x1785x17[_0xd452[62]],{interactionId:_0x1785x14[_0xd452[48]],subject:_0x1785x17[_0xd452[71]],accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};_0x1785x1d= (_0x1785x15[_0xd452[79]]&&  !_0x1785x13[_0xd452[80]])?Mustache[_0xd452[78]](_0x1785x15[_0xd452[79]][_0xd452[60]],{interactionId:_0x1785x14[_0xd452[48]],subject:_0x1785x15[_0xd452[79]][_0xd452[71]]|| _0x1785x17[_0xd452[71]],body:_0x1785x17[_0xd452[60]]|| _0x1785x17[_0xd452[62]]|| _0xd452[81],accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]}):_0x1785x17[_0xd452[60]];_0x1785x1c= _0x1785x17[_0xd452[62]]|| (_0x1785x1d?htmlToText[_0xd452[82]](_0x1785x1d,{wordwrap:false}):_0xd452[81]);if(_0x1785x15[_0xd452[83]]){_0x1785x1d+= _0xd452[84]+ _0x1785x15[_0xd452[83]];_0x1785x1c+= _0xd452[84]+ _0x1785x15[_0xd452[83]]}else {_0x1785x1d+= _0xd452[85];_0x1785x1c+= _0xd452[85]};var _0x1785x23={status:_0x1785x17[_0xd452[50]],from:{name:_0x1785x15[_0xd452[72]],address:_0x1785x15[_0xd452[65]]},to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),subject:(_0x1785x15[_0xd452[79]]&&  !_0x1785x13[_0xd452[80]]&& _0x1785x15[_0xd452[79]][_0xd452[71]])?_0x1785x15[_0xd452[79]][_0xd452[71]]:_0x1785x17[_0xd452[71]],html:_0x1785x1d,text:_0x1785x1c};if(_0x1785x17[_0xd452[86]]){_0x1785x23[_0xd452[87]]= _[_0xd452[89]](_0x1785x17.MailAttachments,function(_0x1785x24){return {path:_0x1785x24[_0xd452[88]],filename:_0x1785x24[_0xd452[72]]}})};return smtp[_0xd452[90]](_0x1785x23)})[_0xd452[38]](function(_0x1785x1e){process[_0xd452[34]]({msgId:_0x1785x17[_0xd452[48]],roomId:_0x1785x14[_0xd452[48]],type:_0xd452[55],messageId:_0x1785x1e[_0xd452[58]],status:_0xd452[59],retry:_0x1785x17[_0xd452[57]],text:_0x1785x1c,html:_0x1785x1d})})[_0xd452[35]](function(_0x1785xb){logger[_0xd452[11]](util[_0xd452[14]](_0xd452[53],_0x1785x17[_0xd452[48]]),_0x1785xb[_0xd452[31]]);process[_0xd452[34]]({msgId:_0x1785x17[_0xd452[48]],roomId:_0x1785x17[_0xd452[54]],type:_0xd452[55],status:_0xd452[56],retry:_0x1785x17[_0xd452[57]],text:_0x1785x1c,html:_0x1785x1d})})}else {return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[102],{where:{id:smtp[_0xd452[45]]},include:[{model:_0xd452[79]}]}])[_0xd452[38]](function(_0x1785x26){_0x1785x15= _0x1785x26;if(_0x1785x17[_0xd452[54]]){return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[100],{where:{id:_0x1785x17[_0xd452[54]]}}])}})[_0xd452[38]](function(_0x1785x27){if(!_0x1785x27){return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[95],{where:{id:_0x1785x13[_0xd452[96]]}}])[_0xd452[38]](function(_0x1785x28){return rpcClient[_0xd452[93]](_0xd452[105],[_0xd452[100],{subject:_0x1785x17[_0xd452[71]],from:_[_0xd452[64]](_0x1785x17[_0xd452[73]])?_0x1785x17[_0xd452[73]][_0xd452[74]](_0xd452[67]):_0x1785x17[_0xd452[73]],account:_0x1785x15?_0x1785x15[_0xd452[72]]:null,status:_0xd452[99],lastEvent:_0xd452[51],attachment:_0x1785x17[_0xd452[86]]&& _0x1785x17[_0xd452[86]][_0xd452[97]],MailAccountId:_0x1785x15?_0x1785x15[_0xd452[48]]:null,mailOut:1,arrivedAt:moment()[_0xd452[14]](_0xd452[106]),MailRoomStatuses:[{status:_0xd452[99],data1:_0x1785x28?_0x1785x28[_0xd452[72]]:null,data2:_0x1785x28?_0x1785x28[_0xd452[75]]:null,UserId:_0x1785x28?_0x1785x28[_0xd452[48]]:null}]},{include:[{model:_0xd452[101]},{model:_0xd452[107]}]}])})}else {return _0x1785x27}})[_0xd452[38]](function(_0x1785x27){_0x1785x14= _0x1785x27;return rpcClient[_0xd452[93]](_0xd452[55],[_0xd452[101],{MailRoomId:_0x1785x27[_0xd452[48]],accountId:_0x1785x15[_0xd452[48]],accountName:_0x1785x15[_0xd452[72]]},{where:{id:_0x1785x13[_0xd452[48]]},individualHooks:true}])})[_0xd452[38]](function(){return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[95],{id:_0x1785x17[_0xd452[96]]}])})[_0xd452[38]](function(_0x1785x25){_0x1785x16= _0x1785x25;if(_0x1785x17[_0xd452[96]]&& _0x1785x14[_0xd452[48]]){return rpcClient[_0xd452[93]](_0xd452[91],[_0xd452[92],{where:{UserId:_0x1785x17[_0xd452[96]],MailRoomId:_0x1785x14[_0xd452[48]]},defaults:{UserId:_0x1785x17[_0xd452[96]],MailRoomId:_0x1785x14[_0xd452[48]]}}])}})[_0xd452[38]](function(){var _0x1785x20=_0x1785x17[_0xd452[63]]?_[_0xd452[64]](_0x1785x17[_0xd452[63]])?_[_0xd452[66]](_0x1785x17[_0xd452[63]],_0x1785x15[_0xd452[65]]):_[_0xd452[66]](_0x1785x17[_0xd452[63]][_0xd452[68]](_0xd452[67]),_0x1785x15[_0xd452[65]]):[];var _0x1785x21=_0x1785x17[_0xd452[69]]?(_[_0xd452[64]](_0x1785x17[_0xd452[69]])?_[_0xd452[66]](_0x1785x17[_0xd452[69]],_0x1785x15[_0xd452[65]]):_[_0xd452[66]](_0x1785x17[_0xd452[69]][_0xd452[68]](_0xd452[67]),_0x1785x15[_0xd452[65]])):[];var _0x1785x22=_0x1785x17[_0xd452[70]]?_[_0xd452[64]](_0x1785x17[_0xd452[70]])?_[_0xd452[66]](_0x1785x17[_0xd452[70]],_0x1785x15[_0xd452[65]]):_[_0xd452[66]](_0x1785x17[_0xd452[70]][_0xd452[68]](_0xd452[67]),_0x1785x15[_0xd452[65]]):[];if(_0x1785x17[_0xd452[71]]){_0x1785x17[_0xd452[71]]= Mustache[_0xd452[78]](_0x1785x17[_0xd452[71]],{interactionId:_0x1785x14[_0xd452[48]],accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};if(_0x1785x15[_0xd452[79]]&& _0x1785x15[_0xd452[79]][_0xd452[71]]&&  !_0x1785x13[_0xd452[80]]){_0x1785x15[_0xd452[79]][_0xd452[71]]= Mustache[_0xd452[78]](_0x1785x15[_0xd452[79]][_0xd452[71]],{interactionId:_0x1785x14[_0xd452[48]],accountName:_0x1785x15[_0xd452[72]],subject:_0x1785x17[_0xd452[71]]|| _0xd452[81],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};if(_0x1785x17[_0xd452[60]]){_0x1785x17[_0xd452[60]]= Mustache[_0xd452[78]](_0x1785x17[_0xd452[60]],{interactionId:_0x1785x14[_0xd452[48]],subject:_0x1785x17[_0xd452[71]],accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};if(_0x1785x17[_0xd452[62]]){_0x1785x17[_0xd452[62]]= Mustache[_0xd452[78]](_0x1785x17[_0xd452[62]],{interactionId:_0x1785x14[_0xd452[48]],subject:_0x1785x17[_0xd452[71]],accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16[_0xd452[75]],agentEmail:_0x1785x16[_0xd452[76]],createdAt:_0x1785x17[_0xd452[77]]})};_0x1785x1d= (_0x1785x15[_0xd452[79]]&&  !_0x1785x13[_0xd452[80]])?Mustache[_0xd452[78]](_0x1785x15[_0xd452[79]][_0xd452[60]],{interactionId:_0x1785x14[_0xd452[48]],subject:_0x1785x15[_0xd452[79]][_0xd452[71]]|| _0x1785x17[_0xd452[71]],body:_0x1785x17[_0xd452[60]]|| _0x1785x17[_0xd452[62]]|| null,accountName:_0x1785x15[_0xd452[72]],from:_0x1785x17[_0xd452[73]],to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),agentName:_0x1785x16?_0x1785x16[_0xd452[75]]:_0xd452[81],agentEmail:_0x1785x16?_0x1785x16[_0xd452[76]]:_0xd452[81],createdAt:_0x1785x17[_0xd452[77]]}):_0x1785x17[_0xd452[60]];_0x1785x1c= _0x1785x17[_0xd452[62]]|| (_0x1785x1d?htmlToText[_0xd452[82]](_0x1785x1d,{wordwrap:false}):_0xd452[81]);if(_0x1785x15[_0xd452[83]]){_0x1785x1d+= _0xd452[84]+ _0x1785x15[_0xd452[83]];_0x1785x1c+= _0xd452[103]+ _0x1785x15[_0xd452[83]]}else {_0x1785x1d+= _0xd452[85];_0x1785x1c+= _0xd452[104]};var _0x1785x23={status:_0x1785x17[_0xd452[50]],from:{name:_0x1785x15[_0xd452[72]],address:_0x1785x15[_0xd452[65]]},to:_0x1785x20[_0xd452[74]](_0xd452[67]),cc:_0x1785x21[_0xd452[74]](_0xd452[67]),bcc:_0x1785x22[_0xd452[74]](_0xd452[67]),subject:(_0x1785x15[_0xd452[79]]&&  !_0x1785x13[_0xd452[80]]&& _0x1785x15[_0xd452[79]][_0xd452[71]])?_0x1785x15[_0xd452[79]][_0xd452[71]]:_0x1785x17[_0xd452[71]],html:_0x1785x1d,text:_0x1785x1c};if(_0x1785x17[_0xd452[86]]){_0x1785x23[_0xd452[87]]= _[_0xd452[89]](_0x1785x17.MailAttachments,function(_0x1785x24){return {path:_0x1785x24[_0xd452[88]],filename:_0x1785x24[_0xd452[72]]}})};return smtp[_0xd452[90]](_0x1785x23)})[_0xd452[38]](function(_0x1785x1e){process[_0xd452[34]]({msgId:_0x1785x17[_0xd452[48]],roomId:_0x1785x14[_0xd452[48]],type:_0xd452[55],messageId:_0x1785x1e[_0xd452[58]],status:_0xd452[59],retry:_0x1785x17[_0xd452[57]],text:_0x1785x1c,html:_0x1785x1d})})[_0xd452[35]](function(_0x1785xb){logger[_0xd452[11]](util[_0xd452[14]](_0xd452[53],_0x1785x17[_0xd452[48]]),_0x1785xb[_0xd452[31]]);process[_0xd452[34]]({msgId:_0x1785x17[_0xd452[48]],roomId:_0x1785x17[_0xd452[54]],type:_0xd452[55],status:_0xd452[56],retry:_0x1785x17[_0xd452[57]],text:_0x1785x1c,html:_0x1785x1d})})}}}return rpcClient[_0xd452[93]](_0xd452[94],[_0xd452[108],{where:{id:process[_0xd452[13]][2]}}])[_0xd452[38]](function(_0x1785x11){onSave(_0x1785x11)})[_0xd452[35]](function(_0x1785xb){logger[_0xd452[11]](_0x1785xb[_0xd452[31]])})
\ No newline at end of file
+var _0xeacd=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x6D\x75\x73\x74\x61\x63\x68\x65","\x6D\x61\x69\x6C","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72","\x6E\x6F\x64\x65\x6D\x61\x69\x6C\x65\x72\x2D\x73\x6D\x74\x70\x2D\x74\x72\x61\x6E\x73\x70\x6F\x72\x74","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x72\x70\x63\x2F\x63\x6C\x69\x65\x6E\x74","\x65\x72\x72\x6F\x72","\x53\x4D\x54\x50\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x25\x73\x20\x45\x52\x52\x4F\x52","\x61\x72\x67\x76","\x66\x6F\x72\x6D\x61\x74","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x58\x49\x54\x45\x44\x20\x57\x49\x54\x48\x20\x43\x4F\x44\x45\x20\x25\x73","\x69\x6E\x66\x6F","\x6D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x73\x74\x61\x74\x65","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x43\x4F\x4E\x4E\x45\x43\x54\x49\x4E\x47","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x54\x41\x52\x54\x49\x4E\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x70\x69\x64","\x67\x63","\x47\x61\x72\x62\x61\x67\x65\x20\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x20\x75\x6E\x61\x76\x61\x69\x6C\x61\x62\x6C\x65\x2E\x20\x20\x50\x61\x73\x73\x20\x2D\x2D\x65\x78\x70\x6F\x73\x65\x2D\x67\x63\x20","\x77\x68\x65\x6E\x20\x6C\x61\x75\x6E\x63\x68\x69\x6E\x67\x20\x6E\x6F\x64\x65\x20\x74\x6F\x20\x65\x6E\x61\x62\x6C\x65\x20\x66\x6F\x72\x63\x65\x64\x20\x67\x61\x72\x62\x61\x67\x65\x20\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x2E","\x77\x61\x72\x6E","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x45\x52\x52\x4F\x52\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x74\x61\x63\x6B","\x45\x52\x52\x4F\x52","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x73\x65\x6E\x64","\x63\x61\x74\x63\x68","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x74\x68\x65\x6E","\x76\x65\x72\x69\x66\x79","\x68\x6F\x73\x74","\x70\x6F\x72\x74","\x73\x73\x6C","\x70\x61\x73\x73\x77\x6F\x72\x64","\x63\x72\x65\x61\x74\x65\x54\x72\x61\x6E\x73\x70\x6F\x72\x74","\x6D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x6D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74\x49\x64","\x69\x64","\x53\x4D\x54\x50\x20\x53\x45\x52\x56\x45\x52\x20\x25\x73\x20\x53\x45\x4E\x44\x49\x4E\x47\x20\x4D\x53\x47\x2C\x20\x50\x52\x4F\x43\x45\x53\x53\x20\x49\x44\x3A\x20\x25\x73\x20","\x73\x74\x61\x74\x75\x73","\x53\x45\x4E\x44\x49\x4E\x47","\x69\x6E\x52\x65\x70\x6C\x79\x54\x6F","\x5B\x53\x4D\x54\x50\x5D\x20\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x25\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x75\x70\x64\x61\x74\x65","\x46\x41\x49\x4C\x45\x44","\x72\x65\x74\x72\x79\x53\x65\x6E\x64","\x6D\x65\x73\x73\x61\x67\x65\x49\x64","\x53\x45\x4E\x54","\x68\x74\x6D\x6C","\x75\x74\x66\x38","\x74\x65\x78\x74","\x74\x6F","\x69\x73\x41\x72\x72\x61\x79","\x61\x64\x64\x72\x65\x73\x73","\x77\x69\x74\x68\x6F\x75\x74","\x3B","\x73\x70\x6C\x69\x74","\x63\x63","\x62\x63\x63","\x73\x75\x62\x6A\x65\x63\x74","\x6E\x61\x6D\x65","\x66\x72\x6F\x6D","\x6A\x6F\x69\x6E","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x72\x65\x6E\x64\x65\x72","\x54\x65\x6D\x70\x6C\x61\x74\x65","\x61\x75\x74\x6F","","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x77\x68\x69\x74\x65\x4C\x61\x62\x65\x6C","\x3C\x62\x72\x3E","\x3C\x62\x72\x3E\x20\x53\x65\x6E\x74\x20\x77\x69\x74\x68\x20\x58\x43\x41\x4C\x4C\x59\xAE","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x70\x61\x74\x68","\x6D\x61\x70","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x55\x73\x65\x72\x48\x61\x73\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x72\x65\x71\x75\x65\x73\x74","\x73\x68\x6F\x77","\x55\x73\x65\x72","\x55\x73\x65\x72\x49\x64","\x6C\x65\x6E\x67\x74\x68","\x6D\x61\x69\x6C\x4F\x75\x74","\x50\x45\x4E\x44\x49\x4E\x47","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x5C\x6E","\x5C\x6E\x20\x53\x65\x6E\x74\x20\x77\x69\x74\x68\x20\x58\x43\x41\x4C\x4C\x59\xAE","\x63\x72\x65\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74"];_0xeacd[0];var util=require(_0xeacd[1]);var _=require(_0xeacd[2]);var moment=require(_0xeacd[3]);var Mustache=require(_0xeacd[4]);var logger=require(_0xeacd[6])(_0xeacd[5]);var nodemailer=require(_0xeacd[7]);var smtpTransport=require(_0xeacd[8]);var htmlToText=require(_0xeacd[9]);var rpcClient=require(_0xeacd[10]);var smtp;process[_0xeacd[15]](_0xeacd[19],function(_0xcdeexd){if(_0xcdeexd[_0xeacd[20]]=== _0xeacd[19]){onSend(_0xcdeexd)};if(_0xcdeexd[_0xeacd[20]]=== _0xeacd[21]){switch(_0xcdeexd[_0xeacd[21]]){case _0xeacd[23]:onVerify(_0xcdeexd[_0xeacd[22]]);break;default:}}})[_0xeacd[15]](_0xeacd[16],function(_0xcdeexc){logger[_0xeacd[18]](util[_0xeacd[14]](_0xeacd[17],process[_0xeacd[13]][3],_0xcdeexc))})[_0xeacd[15]](_0xeacd[11],function(_0xcdeexb){logger[_0xeacd[11]](util[_0xeacd[14]](_0xeacd[12],process[_0xeacd[13]][3]),_0xcdeexb)});logger[_0xeacd[18]](util[_0xeacd[14]](_0xeacd[24],process[_0xeacd[13]][3],process[_0xeacd[25]]));setInterval(function(){if(global[_0xeacd[26]]){global[_0xeacd[26]]()}else {logger[_0xeacd[29]](_0xeacd[27]+ _0xeacd[28])}},20000);function onVerify(_0xcdeexf){smtp[_0xeacd[39]]()[_0xeacd[38]](function(){logger[_0xeacd[18]](util[_0xeacd[14]](_0xeacd[36],_0xcdeexf,process[_0xeacd[25]]));process[_0xeacd[34]]({type:_0xeacd[21],state:_0xeacd[37],source:null})})[_0xeacd[35]](function(_0xcdeexb){logger[_0xeacd[11]](util[_0xeacd[14]](_0xeacd[30],_0xcdeexf,process[_0xeacd[25]]),_0xcdeexb[_0xeacd[31]]);process[_0xeacd[34]]({type:_0xeacd[21],state:_0xeacd[32],source:JSON[_0xeacd[33]](_0xcdeexb)})})}function onSave(_0xcdeex11){smtp= nodemailer[_0xeacd[44]](smtpTransport({host:_0xcdeex11[_0xeacd[40]],port:_0xcdeex11[_0xeacd[41]],secure:_0xcdeex11[_0xeacd[42]],pool:true,auth:{user:_0xcdeex11[_0xeacd[22]],pass:_0xcdeex11[_0xeacd[43]]}}));smtp[_0xeacd[45]]= _0xcdeex11[_0xeacd[46]];smtp[_0xeacd[47]]= _0xcdeex11[_0xeacd[48]];smtp[_0xeacd[22]]= _0xcdeex11[_0xeacd[22]];onVerify(_0xcdeex11[_0xeacd[22]])}function onSend(_0xcdeex13){logger[_0xeacd[18]](util[_0xeacd[14]](_0xeacd[49],process[_0xeacd[13]][3],process[_0xeacd[25]]));if(_0xcdeex13[_0xeacd[50]]=== _0xeacd[51]){var _0xcdeex14;var _0xcdeex15;var _0xcdeex16;var _0xcdeex17=_0xcdeex13;var _0xcdeex18,_0xcdeex19,_0xcdeex1a,_0xcdeex1b;var _0xcdeex1c,_0xcdeex1d;if(_0xcdeex17[_0xeacd[52]]){return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[100],{where:{id:_0xcdeex17[_0xeacd[54]]}}])[_0xeacd[38]](function(_0xcdeex27){_0xcdeex14= _0xcdeex27;return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[102],{where:{id:_0xcdeex27[_0xeacd[46]]},include:[{model:_0xeacd[79]}]}])})[_0xeacd[38]](function(_0xcdeex26){_0xcdeex15= _0xcdeex26;return rpcClient[_0xeacd[93]](_0xeacd[55],[_0xeacd[101],{MailRoomId:_0xcdeex14[_0xeacd[48]]},{where:{id:_0xcdeex17[_0xeacd[48]]}}])})[_0xeacd[38]](function(){var _0xcdeexd={lastEvent:_0xeacd[51],attachment:_0xcdeex17[_0xeacd[86]]&& _0xcdeex17[_0xeacd[86]][_0xeacd[97]],mailOut:++_0xcdeex14[_0xeacd[98]]};if(!_0xcdeex13[_0xeacd[80]]){_0xcdeexd[_0xeacd[50]]= _0xeacd[99]};return rpcClient[_0xeacd[93]](_0xeacd[55],[_0xeacd[100],_0xcdeexd,{where:{id:_0xcdeex14[_0xeacd[48]]}}])})[_0xeacd[38]](function(){return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[95],{where:{id:_0xcdeex17[_0xeacd[96]]}}])})[_0xeacd[38]](function(_0xcdeex25){_0xcdeex16= _0xcdeex25;return rpcClient[_0xeacd[93]](_0xeacd[91],[_0xeacd[92],{where:{UserId:_0xcdeex16[_0xeacd[48]],MailRoomId:_0xcdeex14[_0xeacd[48]]},defaults:{UserId:_0xcdeex16[_0xeacd[48]],MailRoomId:_0xcdeex14[_0xeacd[48]]}}])})[_0xeacd[38]](function(_0xcdeex1f){_0xcdeex17[_0xeacd[60]]= _0xcdeex17[_0xeacd[60]]?_0xcdeex17[_0xeacd[60]].toString(_0xeacd[61]):null;_0xcdeex17[_0xeacd[62]]= _0xcdeex17[_0xeacd[62]]?_0xcdeex17[_0xeacd[62]].toString(_0xeacd[61]):null;var _0xcdeex20=_0xcdeex17[_0xeacd[63]]?_[_0xeacd[64]](_0xcdeex17[_0xeacd[63]])?_[_0xeacd[66]](_0xcdeex17[_0xeacd[63]],_0xcdeex15[_0xeacd[65]]):_[_0xeacd[66]](_0xcdeex17[_0xeacd[63]][_0xeacd[68]](_0xeacd[67]),_0xcdeex15[_0xeacd[65]]):[];var _0xcdeex21=_0xcdeex17[_0xeacd[69]]?(_[_0xeacd[64]](_0xcdeex17[_0xeacd[69]])?_[_0xeacd[66]](_0xcdeex17[_0xeacd[69]],_0xcdeex15[_0xeacd[65]]):_[_0xeacd[66]](_0xcdeex17[_0xeacd[69]][_0xeacd[68]](_0xeacd[67]),_0xcdeex15[_0xeacd[65]])):[];var _0xcdeex22=_0xcdeex17[_0xeacd[70]]?_[_0xeacd[64]](_0xcdeex17[_0xeacd[70]])?_[_0xeacd[66]](_0xcdeex17[_0xeacd[70]],_0xcdeex15[_0xeacd[65]]):_[_0xeacd[66]](_0xcdeex17[_0xeacd[70]][_0xeacd[68]](_0xeacd[67]),_0xcdeex15[_0xeacd[65]]):[];if(_0xcdeex17[_0xeacd[71]]){_0xcdeex17[_0xeacd[71]]= Mustache[_0xeacd[78]](_0xcdeex17[_0xeacd[71]],{interactionId:_0xcdeex14[_0xeacd[48]],accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};if(_0xcdeex15[_0xeacd[79]]&& _0xcdeex15[_0xeacd[79]][_0xeacd[71]]&&  !_0xcdeex13[_0xeacd[80]]){_0xcdeex15[_0xeacd[79]][_0xeacd[71]]= Mustache[_0xeacd[78]](_0xcdeex15[_0xeacd[79]][_0xeacd[71]],{interactionId:_0xcdeex14[_0xeacd[48]],accountName:_0xcdeex15[_0xeacd[72]],subject:_0xcdeex17[_0xeacd[71]]|| _0xeacd[81],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};if(_0xcdeex17[_0xeacd[60]]){_0xcdeex17[_0xeacd[60]]= Mustache[_0xeacd[78]](_0xcdeex17[_0xeacd[60]],{interactionId:_0xcdeex14[_0xeacd[48]],subject:_0xcdeex17[_0xeacd[71]],accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};if(_0xcdeex17[_0xeacd[62]]){_0xcdeex17[_0xeacd[62]]= Mustache[_0xeacd[78]](_0xcdeex17[_0xeacd[62]],{interactionId:_0xcdeex14[_0xeacd[48]],subject:_0xcdeex17[_0xeacd[71]],accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};_0xcdeex1d= (_0xcdeex15[_0xeacd[79]]&&  !_0xcdeex13[_0xeacd[80]])?Mustache[_0xeacd[78]](_0xcdeex15[_0xeacd[79]][_0xeacd[60]],{interactionId:_0xcdeex14[_0xeacd[48]],subject:_0xcdeex15[_0xeacd[79]][_0xeacd[71]]|| _0xcdeex17[_0xeacd[71]],body:_0xcdeex17[_0xeacd[60]]|| _0xcdeex17[_0xeacd[62]]|| _0xeacd[81],accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]}):_0xcdeex17[_0xeacd[60]];_0xcdeex1c= _0xcdeex17[_0xeacd[62]]|| (_0xcdeex1d?htmlToText[_0xeacd[82]](_0xcdeex1d,{wordwrap:false}):_0xeacd[81]);if(_0xcdeex15[_0xeacd[83]]){_0xcdeex1d+= _0xeacd[84]+ _0xcdeex15[_0xeacd[83]];_0xcdeex1c+= _0xeacd[84]+ _0xcdeex15[_0xeacd[83]]}else {_0xcdeex1d+= _0xeacd[85];_0xcdeex1c+= _0xeacd[85]};var _0xcdeex23={status:_0xcdeex17[_0xeacd[50]],from:{name:_0xcdeex15[_0xeacd[72]],address:_0xcdeex15[_0xeacd[65]]},to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),subject:(_0xcdeex15[_0xeacd[79]]&&  !_0xcdeex13[_0xeacd[80]]&& _0xcdeex15[_0xeacd[79]][_0xeacd[71]])?_0xcdeex15[_0xeacd[79]][_0xeacd[71]]:_0xcdeex17[_0xeacd[71]],html:_0xcdeex1d,text:_0xcdeex1c};if(_0xcdeex17[_0xeacd[86]]){_0xcdeex23[_0xeacd[87]]= _[_0xeacd[89]](_0xcdeex17.MailAttachments,function(_0xcdeex24){return {path:_0xcdeex24[_0xeacd[88]],filename:_0xcdeex24[_0xeacd[72]]}})};return smtp[_0xeacd[90]](_0xcdeex23)})[_0xeacd[38]](function(_0xcdeex1e){process[_0xeacd[34]]({msgId:_0xcdeex17[_0xeacd[48]],roomId:_0xcdeex14[_0xeacd[48]],type:_0xeacd[55],messageId:_0xcdeex1e[_0xeacd[58]],status:_0xeacd[59],retry:_0xcdeex17[_0xeacd[57]],text:_0xcdeex1c,html:_0xcdeex1d})})[_0xeacd[35]](function(_0xcdeexb){logger[_0xeacd[11]](util[_0xeacd[14]](_0xeacd[53],_0xcdeex17[_0xeacd[48]]),_0xcdeexb[_0xeacd[31]]);process[_0xeacd[34]]({msgId:_0xcdeex17[_0xeacd[48]],roomId:_0xcdeex17[_0xeacd[54]],type:_0xeacd[55],status:_0xeacd[56],retry:_0xcdeex17[_0xeacd[57]],text:_0xcdeex1c,html:_0xcdeex1d})})}else {return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[102],{where:{id:smtp[_0xeacd[45]]},include:[{model:_0xeacd[79]}]}])[_0xeacd[38]](function(_0xcdeex26){_0xcdeex15= _0xcdeex26;if(_0xcdeex17[_0xeacd[54]]){return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[100],{where:{id:_0xcdeex17[_0xeacd[54]]}}])}})[_0xeacd[38]](function(_0xcdeex27){if(!_0xcdeex27){return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[95],{where:{id:_0xcdeex13[_0xeacd[96]]}}])[_0xeacd[38]](function(_0xcdeex28){return rpcClient[_0xeacd[93]](_0xeacd[105],[_0xeacd[100],{subject:_0xcdeex17[_0xeacd[71]],from:_[_0xeacd[64]](_0xcdeex17[_0xeacd[73]])?_0xcdeex17[_0xeacd[73]][_0xeacd[74]](_0xeacd[67]):_0xcdeex17[_0xeacd[73]],account:_0xcdeex15?_0xcdeex15[_0xeacd[72]]:null,status:_0xeacd[99],lastEvent:_0xeacd[51],attachment:_0xcdeex17[_0xeacd[86]]&& _0xcdeex17[_0xeacd[86]][_0xeacd[97]],MailAccountId:_0xcdeex15?_0xcdeex15[_0xeacd[48]]:null,mailOut:1,arrivedAt:moment()[_0xeacd[14]](_0xeacd[106]),MailRoomStatuses:[{status:_0xeacd[99],data1:_0xcdeex28?_0xcdeex28[_0xeacd[72]]:null,data2:_0xcdeex28?_0xcdeex28[_0xeacd[75]]:null,UserId:_0xcdeex28?_0xcdeex28[_0xeacd[48]]:null}]},{include:[{model:_0xeacd[101]},{model:_0xeacd[107]}]}])})}else {return _0xcdeex27}})[_0xeacd[38]](function(_0xcdeex27){_0xcdeex14= _0xcdeex27;return rpcClient[_0xeacd[93]](_0xeacd[55],[_0xeacd[101],{MailRoomId:_0xcdeex27[_0xeacd[48]],accountId:_0xcdeex15[_0xeacd[48]],accountName:_0xcdeex15[_0xeacd[72]]},{where:{id:_0xcdeex13[_0xeacd[48]]},individualHooks:true}])})[_0xeacd[38]](function(){return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[95],{id:_0xcdeex17[_0xeacd[96]]}])})[_0xeacd[38]](function(_0xcdeex25){_0xcdeex16= _0xcdeex25;if(_0xcdeex17[_0xeacd[96]]&& _0xcdeex14[_0xeacd[48]]){return rpcClient[_0xeacd[93]](_0xeacd[91],[_0xeacd[92],{where:{UserId:_0xcdeex17[_0xeacd[96]],MailRoomId:_0xcdeex14[_0xeacd[48]]},defaults:{UserId:_0xcdeex17[_0xeacd[96]],MailRoomId:_0xcdeex14[_0xeacd[48]]}}])}})[_0xeacd[38]](function(){var _0xcdeex20=_0xcdeex17[_0xeacd[63]]?_[_0xeacd[64]](_0xcdeex17[_0xeacd[63]])?_[_0xeacd[66]](_0xcdeex17[_0xeacd[63]],_0xcdeex15[_0xeacd[65]]):_[_0xeacd[66]](_0xcdeex17[_0xeacd[63]][_0xeacd[68]](_0xeacd[67]),_0xcdeex15[_0xeacd[65]]):[];var _0xcdeex21=_0xcdeex17[_0xeacd[69]]?(_[_0xeacd[64]](_0xcdeex17[_0xeacd[69]])?_[_0xeacd[66]](_0xcdeex17[_0xeacd[69]],_0xcdeex15[_0xeacd[65]]):_[_0xeacd[66]](_0xcdeex17[_0xeacd[69]][_0xeacd[68]](_0xeacd[67]),_0xcdeex15[_0xeacd[65]])):[];var _0xcdeex22=_0xcdeex17[_0xeacd[70]]?_[_0xeacd[64]](_0xcdeex17[_0xeacd[70]])?_[_0xeacd[66]](_0xcdeex17[_0xeacd[70]],_0xcdeex15[_0xeacd[65]]):_[_0xeacd[66]](_0xcdeex17[_0xeacd[70]][_0xeacd[68]](_0xeacd[67]),_0xcdeex15[_0xeacd[65]]):[];if(_0xcdeex17[_0xeacd[71]]){_0xcdeex17[_0xeacd[71]]= Mustache[_0xeacd[78]](_0xcdeex17[_0xeacd[71]],{interactionId:_0xcdeex14[_0xeacd[48]],accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};if(_0xcdeex15[_0xeacd[79]]&& _0xcdeex15[_0xeacd[79]][_0xeacd[71]]&&  !_0xcdeex13[_0xeacd[80]]){_0xcdeex15[_0xeacd[79]][_0xeacd[71]]= Mustache[_0xeacd[78]](_0xcdeex15[_0xeacd[79]][_0xeacd[71]],{interactionId:_0xcdeex14[_0xeacd[48]],accountName:_0xcdeex15[_0xeacd[72]],subject:_0xcdeex17[_0xeacd[71]]|| _0xeacd[81],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};if(_0xcdeex17[_0xeacd[60]]){_0xcdeex17[_0xeacd[60]]= Mustache[_0xeacd[78]](_0xcdeex17[_0xeacd[60]],{interactionId:_0xcdeex14[_0xeacd[48]],subject:_0xcdeex17[_0xeacd[71]],accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};if(_0xcdeex17[_0xeacd[62]]){_0xcdeex17[_0xeacd[62]]= Mustache[_0xeacd[78]](_0xcdeex17[_0xeacd[62]],{interactionId:_0xcdeex14[_0xeacd[48]],subject:_0xcdeex17[_0xeacd[71]],accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16[_0xeacd[75]],agentEmail:_0xcdeex16[_0xeacd[76]],createdAt:_0xcdeex17[_0xeacd[77]]})};_0xcdeex1d= (_0xcdeex15[_0xeacd[79]]&&  !_0xcdeex13[_0xeacd[80]])?Mustache[_0xeacd[78]](_0xcdeex15[_0xeacd[79]][_0xeacd[60]],{interactionId:_0xcdeex14[_0xeacd[48]],subject:_0xcdeex15[_0xeacd[79]][_0xeacd[71]]|| _0xcdeex17[_0xeacd[71]],body:_0xcdeex17[_0xeacd[60]]|| _0xcdeex17[_0xeacd[62]]|| null,accountName:_0xcdeex15[_0xeacd[72]],from:_0xcdeex17[_0xeacd[73]],to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),agentName:_0xcdeex16?_0xcdeex16[_0xeacd[75]]:_0xeacd[81],agentEmail:_0xcdeex16?_0xcdeex16[_0xeacd[76]]:_0xeacd[81],createdAt:_0xcdeex17[_0xeacd[77]]}):_0xcdeex17[_0xeacd[60]];_0xcdeex1c= _0xcdeex17[_0xeacd[62]]|| (_0xcdeex1d?htmlToText[_0xeacd[82]](_0xcdeex1d,{wordwrap:false}):_0xeacd[81]);if(_0xcdeex15[_0xeacd[83]]){_0xcdeex1d+= _0xeacd[84]+ _0xcdeex15[_0xeacd[83]];_0xcdeex1c+= _0xeacd[103]+ _0xcdeex15[_0xeacd[83]]}else {_0xcdeex1d+= _0xeacd[85];_0xcdeex1c+= _0xeacd[104]};var _0xcdeex23={status:_0xcdeex17[_0xeacd[50]],from:{name:_0xcdeex15[_0xeacd[72]],address:_0xcdeex15[_0xeacd[65]]},to:_0xcdeex20[_0xeacd[74]](_0xeacd[67]),cc:_0xcdeex21[_0xeacd[74]](_0xeacd[67]),bcc:_0xcdeex22[_0xeacd[74]](_0xeacd[67]),subject:(_0xcdeex15[_0xeacd[79]]&&  !_0xcdeex13[_0xeacd[80]]&& _0xcdeex15[_0xeacd[79]][_0xeacd[71]])?_0xcdeex15[_0xeacd[79]][_0xeacd[71]]:_0xcdeex17[_0xeacd[71]],html:_0xcdeex1d,text:_0xcdeex1c};if(_0xcdeex17[_0xeacd[86]]){_0xcdeex23[_0xeacd[87]]= _[_0xeacd[89]](_0xcdeex17.MailAttachments,function(_0xcdeex24){return {path:_0xcdeex24[_0xeacd[88]],filename:_0xcdeex24[_0xeacd[72]]}})};return smtp[_0xeacd[90]](_0xcdeex23)})[_0xeacd[38]](function(_0xcdeex1e){process[_0xeacd[34]]({msgId:_0xcdeex17[_0xeacd[48]],roomId:_0xcdeex14[_0xeacd[48]],type:_0xeacd[55],messageId:_0xcdeex1e[_0xeacd[58]],status:_0xeacd[59],retry:_0xcdeex17[_0xeacd[57]],text:_0xcdeex1c,html:_0xcdeex1d})})[_0xeacd[35]](function(_0xcdeexb){logger[_0xeacd[11]](util[_0xeacd[14]](_0xeacd[53],_0xcdeex17[_0xeacd[48]]),_0xcdeexb[_0xeacd[31]]);process[_0xeacd[34]]({msgId:_0xcdeex17[_0xeacd[48]],roomId:_0xcdeex17[_0xeacd[54]],type:_0xeacd[55],status:_0xeacd[56],retry:_0xcdeex17[_0xeacd[57]],text:_0xcdeex1c,html:_0xcdeex1d})})}}}return rpcClient[_0xeacd[93]](_0xeacd[94],[_0xeacd[108],{where:{id:process[_0xeacd[13]][2]}}])[_0xeacd[38]](function(_0xcdeex11){onSave(_0xcdeex11)})[_0xeacd[35]](function(_0xcdeexb){logger[_0xeacd[11]](_0xcdeexb[_0xeacd[31]])})
\ No newline at end of file