Built motion from commit b18b7a808.|1.0.23
[motion.git] / server / api / mail_room / mail_room.controller.js
index 99531f8..22e3c79 100644 (file)
@@ -1 +1 @@
-var _0xfa87=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\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","\x4D\x61\x69\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x69\x64","\x6D\x61\x70","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x6E\x65\x77","\x4E\x45\x57","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x69\x6E\x62\x6F\x78","\x65\x72\x72\x6F\x72","\x53\x45\x4C\x45\x43\x54\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x20\x4C\x45\x46\x54\x20\x4F\x55\x54\x45\x52\x20\x4A\x4F\x49\x4E\x20\x28\x60\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x49\x4E\x4E\x45\x52\x20\x4A\x4F\x49\x4E\x20\x60\x75\x73\x65\x72\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x60\x20\x4F\x4E\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x41\x4E\x44\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x20\x3D\x20\x3A\x73\x74\x61\x74\x75\x73\x20\x4F\x52\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x3A\x69\x64\x29\x29","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x67\x65\x6E\x74","\x53\x45\x4C\x45\x43\x54\x20\x60\x69\x64\x60\x2C\x20\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x20\x2C\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\x61\x64\x64\x55\x73\x65\x72","\x75\x70\x64\x61\x74\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x65\x78\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x2C","\x73\x70\x6C\x69\x74","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xfa87[0];var _=require(_0xfa87[1]);var util=require(_0xfa87[2]);var htmlToText=require(_0xfa87[3]);var Util=require(_0xfa87[4]);var moment=require(_0xfa87[5]);var sequelize=require(_0xfa87[7])[_0xfa87[6]];var User=require(_0xfa87[7])[_0xfa87[8]];var Agent=require(_0xfa87[7])[_0xfa87[8]];var Contact=require(_0xfa87[7])[_0xfa87[9]];var Status=require(_0xfa87[7])[_0xfa87[10]];var MailRoom=require(_0xfa87[7])[_0xfa87[11]];var MailMessage=require(_0xfa87[7])[_0xfa87[12]];var MailAccount=require(_0xfa87[7])[_0xfa87[13]];var MailApplication=require(_0xfa87[7])[_0xfa87[14]];var MailQueue=require(_0xfa87[7])[_0xfa87[15]];var MailAttachment=require(_0xfa87[7])[_0xfa87[16]];exports[_0xfa87[17]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[26]](_0xfa87[25])[_0xfa87[24]](Util[_0xfa87[23]](_0x2747x11[_0xfa87[22]]))[_0xfa87[21]](function(_0x2747x15){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]](_0x2747x15)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};function getMailQueues(_0x2747x17){return function(){switch(_0x2747x17[_0xfa87[32]]){case _0xfa87[31]:return User[_0xfa87[30]](_0x2747x17[_0xfa87[27]],{attributes:[_0xfa87[27]]})[_0xfa87[21]](Util[_0xfa87[29]]({},{attributes:[_0xfa87[27]]}))[_0xfa87[21]](function(_0x2747x18){return {include:{model:MailAccount,include:{model:MailApplication,include:{model:MailQueue,where:{id:_[_0xfa87[28]](_0x2747x18,_0xfa87[27])}}}}}});default:return {}}}}exports[_0xfa87[33]]= function(_0x2747x11,_0x2747x12){return Promise[_0xfa87[39]]([])[_0xfa87[21]](getMailQueues(_0x2747x11[_0xfa87[31]]))[_0xfa87[21]](function(_0x2747x1a){return MailRoom[_0xfa87[38]](_[_0xfa87[37]]({where:{status:_0xfa87[34],createdAt:{$gte:moment()[_0xfa87[36]](_0xfa87[35])}}},_0x2747x1a))})[_0xfa87[21]](function(_0x2747x19){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]]({value:_0x2747x19})})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[40]]= function(_0x2747x11,_0x2747x12){return Promise[_0xfa87[39]]([])[_0xfa87[21]](getMailQueues(_0x2747x11[_0xfa87[31]]))[_0xfa87[21]](function(_0x2747x1a){return MailRoom[_0xfa87[38]](_[_0xfa87[37]]({where:{status:_0xfa87[41],createdAt:{$gte:moment()[_0xfa87[36]](_0xfa87[35])}}},_0x2747x1a))})[_0xfa87[21]](function(_0x2747x19){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]]({value:_0x2747x19})})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[42]]= function(_0x2747x11,_0x2747x12){return Promise[_0xfa87[39]]([])[_0xfa87[21]](getMailQueues(_0x2747x11[_0xfa87[31]]))[_0xfa87[21]](function(_0x2747x1a){return MailRoom[_0xfa87[38]](_[_0xfa87[37]]({where:{status:_0xfa87[43],createdAt:{$gte:moment()[_0xfa87[36]](_0xfa87[35])}}},_0x2747x1a))})[_0xfa87[21]](function(_0x2747x19){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]]({value:_0x2747x19})})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[44]]= function(_0x2747x11,_0x2747x12){return Promise[_0xfa87[39]]([])[_0xfa87[21]](getMailQueues(_0x2747x11[_0xfa87[31]]))[_0xfa87[21]](function(_0x2747x1a){return MailRoom[_0xfa87[38]](_[_0xfa87[37]]({where:{status:_0xfa87[45],createdAt:{$gte:moment()[_0xfa87[36]](_0xfa87[35])}}},_0x2747x1a))})[_0xfa87[21]](function(_0x2747x19){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]]({value:_0x2747x19})})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[46]]= function(_0x2747x11,_0x2747x12,_0x2747x13){switch(_0x2747x11[_0xfa87[31]][_0xfa87[32]]){case _0xfa87[51]:return sequelize[_0xfa87[22]](_0xfa87[48],{replacements:{status:_0xfa87[45],id:_0x2747x11[_0xfa87[31]][_0xfa87[27]]},type:sequelize[_0xfa87[50]][_0xfa87[49]]})[_0xfa87[21]](function(_0x2747x15){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]](_0x2747x15)})[_0xfa87[18]](function(_0x2747x14){console[_0xfa87[47]](_0x2747x14);return handleError(_0x2747x12,_0x2747x14)});default:return sequelize[_0xfa87[22]](_0xfa87[52],{replacements:{status:_0xfa87[45],id:_0x2747x11[_0xfa87[31]][_0xfa87[27]]},type:sequelize[_0xfa87[50]][_0xfa87[49]]})[_0xfa87[21]](function(_0x2747x15){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]](_0x2747x15)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})}};exports[_0xfa87[53]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[55]]({where:{UserId:_0x2747x11[_0xfa87[54]][_0xfa87[27]]},include:[{all:true}]})[_0xfa87[21]](function(_0x2747x1b){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]](_0x2747x1b)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[56]]= function(_0x2747x11,_0x2747x12,_0x2747x13){var _0x2747x1c;if(_0x2747x11[_0xfa87[31]][_0xfa87[32]]=== _0xfa87[51]){return MailRoom[_0xfa87[30]](_0x2747x11[_0xfa87[54]][_0xfa87[27]])[_0xfa87[21]](function(_0x2747x1d){_0x2747x1c= _0x2747x1d;if(!_0x2747x1c){return _0x2747x12[_0xfa87[57]](404)};return _0x2747x1c[_0xfa87[63]](_0x2747x11[_0xfa87[58]],{userId:_0x2747x11[_0xfa87[31]][_0xfa87[27]]})})[_0xfa87[21]](function(){return _0x2747x1c[_0xfa87[62]](_0x2747x11[_0xfa87[31]][_0xfa87[27]])})[_0xfa87[21]](function(){return Status[_0xfa87[61]]({status:_0x2747x11[_0xfa87[58]][_0xfa87[20]],data1:_0x2747x11[_0xfa87[31]][_0xfa87[59]],data2:_0x2747x11[_0xfa87[31]][_0xfa87[60]],MailRoomId:_0x2747x1c[_0xfa87[27]],UserId:_0x2747x11[_0xfa87[31]][_0xfa87[27]]})})[_0xfa87[21]](function(){return _0x2747x12[_0xfa87[57]](200)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})}};exports[_0xfa87[64]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailMessage[_0xfa87[30]](_0x2747x11[_0xfa87[54]][_0xfa87[27]])[_0xfa87[21]](function(_0x2747x1e){return _0x2747x1e[_0xfa87[66]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0xfa87[27],_0xfa87[59],_0xfa87[60],_0xfa87[65]]}]},{model:User,attributes:[_0xfa87[27],_0xfa87[59],_0xfa87[60],_0xfa87[65]]}]})})[_0xfa87[21]](function(_0x2747x1d){return _0x2747x12[_0xfa87[19]](_0x2747x1d)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[67]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[26]](_0xfa87[25])[_0xfa87[30]](_0x2747x11[_0xfa87[54]][_0xfa87[27]])[_0xfa87[21]](function(_0x2747x1d){if(!_0x2747x1d){return _0x2747x12[_0xfa87[57]](404)};return _0x2747x12[_0xfa87[19]](_0x2747x1d)})[_0xfa87[18]](function(_0x2747x14){console[_0xfa87[47]](_0x2747x14);return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[68]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[30]](_0x2747x11[_0xfa87[54]][_0xfa87[27]])[_0xfa87[21]](function(_0x2747x1d){if(!_0x2747x1d){return _0x2747x12[_0xfa87[57]](404)};return _0x2747x1d[_0xfa87[70]]({attributes:[_0xfa87[27],_0xfa87[59],_0xfa87[60],_0xfa87[65],_0xfa87[32],_0xfa87[69]]})})[_0xfa87[21]](function(_0x2747x1f){return _0x2747x12[_0xfa87[19]](_0x2747x1f)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[61]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[61]](_0x2747x11[_0xfa87[58]])[_0xfa87[21]](function(_0x2747x1d){return _0x2747x12[_0xfa87[20]](201)[_0xfa87[19]](_0x2747x1d)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[71]]= function(_0x2747x11,_0x2747x12,_0x2747x13){_0x2747x11[_0xfa87[58]][_0xfa87[72]]= _0x2747x11[_0xfa87[31]][_0xfa87[27]];_0x2747x11[_0xfa87[58]][_0xfa87[73]]= _0x2747x11[_0xfa87[54]][_0xfa87[27]];_0x2747x11[_0xfa87[58]][_0xfa87[74]]= (_0x2747x11[_0xfa87[58]][_0xfa87[75]]&& _0x2747x11[_0xfa87[58]][_0xfa87[75]][_0xfa87[76]])?true:false;_0x2747x11[_0xfa87[58]][_0xfa87[77]]= _0x2747x11[_0xfa87[58]][_0xfa87[77]]|| htmlToText[_0xfa87[79]](_0x2747x11[_0xfa87[58]][_0xfa87[78]],{wordwrap:false});return MailRoom[_0xfa87[30]](_0x2747x11[_0xfa87[58]].MailRoomId)[_0xfa87[21]](function(_0x2747x1d){return _0x2747x1d[_0xfa87[63]]({status:_0xfa87[80]})})[_0xfa87[21]](function(){return Status[_0xfa87[61]]({status:_0xfa87[80],data1:_0x2747x11[_0xfa87[31]][_0xfa87[59]],data2:_0x2747x11[_0xfa87[31]][_0xfa87[60]],UserId:_0x2747x11[_0xfa87[31]][_0xfa87[27]],MailRoomId:_0x2747x11[_0xfa87[54]][_0xfa87[27]]})})[_0xfa87[21]](function(){return MailMessage[_0xfa87[61]](_0x2747x11[_0xfa87[58]],{include:[{model:MailAttachment}],user:_0x2747x11[_0xfa87[31]]})})[_0xfa87[21]](function(_0x2747x1e){return _0x2747x12[_0xfa87[20]](201)[_0xfa87[19]](_0x2747x1e)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[63]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[30]](_0x2747x11[_0xfa87[54]][_0xfa87[27]])[_0xfa87[21]](function(_0x2747x1d){if(!_0x2747x1d){return _0x2747x12[_0xfa87[57]](404)};return _0x2747x1d[_0xfa87[63]](_0x2747x11[_0xfa87[58]])})[_0xfa87[21]](function(_0x2747x1d){return _0x2747x12[_0xfa87[20]](200)[_0xfa87[19]](_0x2747x1d)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[81]]= function(_0x2747x11,_0x2747x12,_0x2747x13){var _0x2747x20={tags:_0x2747x11[_0xfa87[58]][_0xfa87[82]]};var _0x2747x21={where:{id:_0x2747x11[_0xfa87[54]][_0xfa87[27]][_0xfa87[84]](_0xfa87[83])}};return MailRoom[_0xfa87[63]](_0x2747x20,_0x2747x21)[_0xfa87[21]](function(_0x2747x1b){if(!_0x2747x1b){return _0x2747x12[_0xfa87[57]](404)};return _0x2747x1b})[_0xfa87[21]](function(_0x2747x1b){return _0x2747x12[_0xfa87[57]](200)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[85]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[30]](_0x2747x11[_0xfa87[54]][_0xfa87[27]])[_0xfa87[21]](function(_0x2747x1d){if(!_0x2747x1d){return _0x2747x12[_0xfa87[57]](404)};return _0x2747x1d[_0xfa87[87]](_0x2747x11[_0xfa87[58]][_0xfa87[86]],{individualHooks:true})})[_0xfa87[21]](function(){return _0x2747x12[_0xfa87[57]](200)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[88]]= function(_0x2747x11,_0x2747x12,_0x2747x13){return MailRoom[_0xfa87[30]](_0x2747x11[_0xfa87[54]][_0xfa87[27]])[_0xfa87[21]](function(_0x2747x1d){if(!_0x2747x1d){return _0x2747x12[_0xfa87[57]](404)};return _0x2747x1d[_0xfa87[88]]()})[_0xfa87[21]](function(){return _0x2747x12[_0xfa87[57]](204)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};exports[_0xfa87[89]]= function(_0x2747x11,_0x2747x12){return MailRoom[_0xfa87[88]]({where:{id:_0x2747x11[_0xfa87[22]][_0xfa87[90]]},individualHooks:true})[_0xfa87[21]](function(){return _0x2747x12[_0xfa87[57]](200)})[_0xfa87[18]](function(_0x2747x14){return handleError(_0x2747x12,_0x2747x14)})};function handleError(_0x2747x12,_0x2747x14){return _0x2747x12[_0xfa87[20]](500)[_0xfa87[19]](_0x2747x14)}
\ No newline at end of file
+var _0x97c6=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\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","\x4D\x61\x69\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x69\x64","\x6D\x61\x70","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x70\x65\x6E\x64\x69\x6E\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x6E\x65\x77","\x4E\x45\x57","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x69\x6E\x62\x6F\x78","\x53\x45\x4C\x45\x43\x54\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x20\x4C\x45\x46\x54\x20\x4F\x55\x54\x45\x52\x20\x4A\x4F\x49\x4E\x20\x28\x60\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x49\x4E\x4E\x45\x52\x20\x4A\x4F\x49\x4E\x20\x60\x75\x73\x65\x72\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x60\x20\x4F\x4E\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x41\x4E\x44\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x20\x3D\x20\x3A\x73\x74\x61\x74\x75\x73\x20\x4F\x52\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x3A\x69\x64\x29\x29","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x67\x65\x6E\x74","\x53\x45\x4C\x45\x43\x54\x20\x60\x69\x64\x60\x2C\x20\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x20\x2C\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x64\x65\x62\x75\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x2C","\x73\x70\x6C\x69\x74","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x65\x78\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x61\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x61\x63\x63\x6F\x75\x6E\x74\x4E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x97c6[0];var _=require(_0x97c6[1]);var util=require(_0x97c6[2]);var htmlToText=require(_0x97c6[3]);var Util=require(_0x97c6[4]);var moment=require(_0x97c6[5]);var logger=require(_0x97c6[7])(_0x97c6[6]);var sequelize=require(_0x97c6[9])[_0x97c6[8]];var User=require(_0x97c6[9])[_0x97c6[10]];var Agent=require(_0x97c6[9])[_0x97c6[10]];var Contact=require(_0x97c6[9])[_0x97c6[11]];var Status=require(_0x97c6[9])[_0x97c6[12]];var MailRoom=require(_0x97c6[9])[_0x97c6[13]];var MailMessage=require(_0x97c6[9])[_0x97c6[14]];var MailAccount=require(_0x97c6[9])[_0x97c6[15]];var MailApplication=require(_0x97c6[9])[_0x97c6[16]];var MailQueue=require(_0x97c6[9])[_0x97c6[17]];var MailAttachment=require(_0x97c6[9])[_0x97c6[18]];exports[_0x97c6[19]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[28]](_0x97c6[27])[_0x97c6[26]](Util[_0x97c6[25]](_0x86bfx12[_0x97c6[24]]))[_0x97c6[23]](function(_0x86bfx16){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]](_0x86bfx16)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[29]]= function(_0x86bfx12,_0x86bfx13){return MailRoom[_0x97c6[29]]()[_0x97c6[23]](function(_0x86bfx17){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]](_0x86bfx17)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};function getMailQueues(_0x86bfx19){return function(){switch(_0x86bfx19[_0x97c6[35]]){case _0x97c6[34]:return User[_0x97c6[33]](_0x86bfx19[_0x97c6[30]],{attributes:[_0x97c6[30]]})[_0x97c6[23]](Util[_0x97c6[32]]({},{attributes:[_0x97c6[30]]}))[_0x97c6[23]](function(_0x86bfx1a){return {include:{model:MailAccount,include:{model:MailApplication,include:{model:MailQueue,where:{id:_[_0x97c6[31]](_0x86bfx1a,_0x97c6[30])}}}}}});default:return {}}}}exports[_0x97c6[36]]= function(_0x86bfx12,_0x86bfx13){return Promise[_0x97c6[42]]([])[_0x97c6[23]](getMailQueues(_0x86bfx12[_0x97c6[34]]))[_0x97c6[23]](function(_0x86bfx1c){return MailRoom[_0x97c6[41]](_[_0x97c6[40]](Util[_0x97c6[25]](_0x86bfx12[_0x97c6[24]],{status:_0x97c6[37],updatedAt:{$gte:moment()[_0x97c6[39]](_0x97c6[38])}}),_0x86bfx1c))})[_0x97c6[23]](function(_0x86bfx1b){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]]({value:_0x86bfx1b})})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[43]]= function(_0x86bfx12,_0x86bfx13){return Promise[_0x97c6[42]]([])[_0x97c6[23]](getMailQueues(_0x86bfx12[_0x97c6[34]]))[_0x97c6[23]](function(_0x86bfx1c){return MailRoom[_0x97c6[41]](_[_0x97c6[40]](Util[_0x97c6[25]](_0x86bfx12[_0x97c6[24]],{status:_0x97c6[44],updatedAt:{$gte:moment()[_0x97c6[39]](_0x97c6[38])}}),_0x86bfx1c))})[_0x97c6[23]](function(_0x86bfx1b){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]]({value:_0x86bfx1b})})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[45]]= function(_0x86bfx12,_0x86bfx13){return Promise[_0x97c6[42]]([])[_0x97c6[23]](getMailQueues(_0x86bfx12[_0x97c6[34]]))[_0x97c6[23]](function(_0x86bfx1c){return MailRoom[_0x97c6[41]](_[_0x97c6[40]](Util[_0x97c6[25]](_0x86bfx12[_0x97c6[24]],{status:_0x97c6[46],updatedAt:{$gte:moment()[_0x97c6[39]](_0x97c6[38])}}),_0x86bfx1c))})[_0x97c6[23]](function(_0x86bfx1b){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]]({value:_0x86bfx1b})})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[47]]= function(_0x86bfx12,_0x86bfx13){return Promise[_0x97c6[42]]([])[_0x97c6[23]](getMailQueues(_0x86bfx12[_0x97c6[34]]))[_0x97c6[23]](function(_0x86bfx1c){return MailRoom[_0x97c6[41]](_[_0x97c6[40]](Util[_0x97c6[25]](_0x86bfx12[_0x97c6[24]],{status:_0x97c6[48],updatedAt:{$gte:moment()[_0x97c6[39]](_0x97c6[38])}}),_0x86bfx1c))})[_0x97c6[23]](function(_0x86bfx1b){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]]({value:_0x86bfx1b})})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[49]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){switch(_0x86bfx12[_0x97c6[34]][_0x97c6[35]]){case _0x97c6[54]:return sequelize[_0x97c6[24]](_0x97c6[50],{replacements:{status:_0x97c6[51],id:_0x86bfx12[_0x97c6[34]][_0x97c6[30]]},type:sequelize[_0x97c6[53]][_0x97c6[52]]})[_0x97c6[23]](function(_0x86bfx16){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]](_0x86bfx16)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)});default:return sequelize[_0x97c6[24]](_0x97c6[55],{replacements:{status:_0x97c6[51],id:_0x86bfx12[_0x97c6[34]][_0x97c6[30]]},type:sequelize[_0x97c6[53]][_0x97c6[52]]})[_0x97c6[23]](function(_0x86bfx16){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]](_0x86bfx16)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})}};exports[_0x97c6[56]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[58]]({where:{UserId:_0x86bfx12[_0x97c6[57]][_0x97c6[30]]},include:[{all:true}]})[_0x97c6[23]](function(_0x86bfx1d){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]](_0x86bfx1d)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[59]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){var _0x86bfx1e;var _0x86bfx1f=[];logger[_0x97c6[61]](_0x86bfx12[_0x97c6[60]]);logger[_0x97c6[61]](_0x86bfx12[_0x97c6[57]]);return MailRoom[_0x97c6[68]](_0x86bfx12[_0x97c6[60]],{where:{id:_0x86bfx12[_0x97c6[57]][_0x97c6[30]][_0x97c6[64]](_0x97c6[63])},individualHooks:true})[_0x97c6[23]](function(){return Status[_0x97c6[67]](_[_0x97c6[31]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]][_0x97c6[64]](_0x97c6[63]),function(_0x86bfx20){return {status:_0x86bfx12[_0x97c6[60]][_0x97c6[22]],data1:_0x86bfx12[_0x97c6[34]][_0x97c6[65]],data2:_0x86bfx12[_0x97c6[34]][_0x97c6[66]],MailRoomId:_0x86bfx20,UserId:_0x86bfx12[_0x97c6[34]][_0x97c6[30]]}}))})[_0x97c6[23]](function(_0x86bfx1d){return _0x86bfx13[_0x97c6[62]](200)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[69]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailMessage[_0x97c6[33]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]])[_0x97c6[23]](function(_0x86bfx22){return _0x86bfx22[_0x97c6[71]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0x97c6[30],_0x97c6[65],_0x97c6[66],_0x97c6[70]]}]},{model:User,attributes:[_0x97c6[30],_0x97c6[65],_0x97c6[66],_0x97c6[70]]}]})})[_0x97c6[23]](function(_0x86bfx21){return _0x86bfx13[_0x97c6[21]](_0x86bfx21)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[72]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[28]](_0x97c6[27])[_0x97c6[33]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]])[_0x97c6[23]](function(_0x86bfx21){if(!_0x86bfx21){return _0x86bfx13[_0x97c6[62]](404)};return _0x86bfx13[_0x97c6[21]](_0x86bfx21)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[73]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[33]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]])[_0x97c6[23]](function(_0x86bfx21){if(!_0x86bfx21){return _0x86bfx13[_0x97c6[62]](404)};return _0x86bfx21[_0x97c6[75]]({attributes:[_0x97c6[30],_0x97c6[65],_0x97c6[66],_0x97c6[70],_0x97c6[35],_0x97c6[74]]})})[_0x97c6[23]](function(_0x86bfx23){return _0x86bfx13[_0x97c6[21]](_0x86bfx23)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[76]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[76]](_0x86bfx12[_0x97c6[60]])[_0x97c6[23]](function(_0x86bfx21){return _0x86bfx13[_0x97c6[22]](201)[_0x97c6[21]](_0x86bfx21)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[77]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){_0x86bfx12[_0x97c6[60]][_0x97c6[78]]= _0x86bfx12[_0x97c6[34]][_0x97c6[30]];_0x86bfx12[_0x97c6[60]][_0x97c6[79]]= _0x86bfx12[_0x97c6[57]][_0x97c6[30]];_0x86bfx12[_0x97c6[60]][_0x97c6[80]]= (_0x86bfx12[_0x97c6[60]][_0x97c6[81]]&& _0x86bfx12[_0x97c6[60]][_0x97c6[81]][_0x97c6[82]])?true:false;_0x86bfx12[_0x97c6[60]][_0x97c6[83]]= _0x86bfx12[_0x97c6[60]][_0x97c6[83]]|| htmlToText[_0x97c6[85]](_0x86bfx12[_0x97c6[60]][_0x97c6[84]],{wordwrap:false});return MailRoom[_0x97c6[33]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]])[_0x97c6[23]](function(_0x86bfx21){_0x86bfx12[_0x97c6[60]][_0x97c6[86]]= _0x86bfx21[_0x97c6[87]];_0x86bfx12[_0x97c6[60]][_0x97c6[88]]= _0x86bfx21[_0x97c6[89]];return MailMessage[_0x97c6[76]](_0x86bfx12[_0x97c6[60]],{include:[{model:MailAttachment}],user:_0x86bfx12[_0x97c6[34]]})})[_0x97c6[23]](function(_0x86bfx22){return _0x86bfx13[_0x97c6[22]](201)[_0x97c6[21]](_0x86bfx22)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[68]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[33]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]])[_0x97c6[23]](function(_0x86bfx21){if(!_0x86bfx21){return _0x86bfx13[_0x97c6[62]](404)};return _0x86bfx21[_0x97c6[68]](_0x86bfx12[_0x97c6[60]])})[_0x97c6[23]](function(_0x86bfx21){return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]](_0x86bfx21)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[90]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){var _0x86bfx24={where:{id:_0x86bfx12[_0x97c6[57]][_0x97c6[30]][_0x97c6[64]](_0x97c6[63])},user:_0x86bfx12[_0x97c6[34]],individualHooks:true};return MailRoom[_0x97c6[68]](_0x86bfx12[_0x97c6[60]],_0x86bfx24)[_0x97c6[23]](function(_0x86bfx1d){if(!_0x86bfx1d){return _0x86bfx13[_0x97c6[62]](404)};return _0x86bfx1d})[_0x97c6[23]](function(_0x86bfx1d){return _0x86bfx13[_0x97c6[62]](200)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[91]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[33]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]])[_0x97c6[23]](function(_0x86bfx21){if(!_0x86bfx21){return _0x86bfx13[_0x97c6[62]](404)};return _0x86bfx21[_0x97c6[93]](_0x86bfx12[_0x97c6[60]][_0x97c6[92]],{individualHooks:true})})[_0x97c6[23]](function(){return _0x86bfx13[_0x97c6[62]](200)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[94]]= function(_0x86bfx12,_0x86bfx13,_0x86bfx14){return MailRoom[_0x97c6[33]](_0x86bfx12[_0x97c6[57]][_0x97c6[30]])[_0x97c6[23]](function(_0x86bfx21){if(!_0x86bfx21){return _0x86bfx13[_0x97c6[62]](404)};return _0x86bfx21[_0x97c6[94]]()})[_0x97c6[23]](function(){return _0x86bfx13[_0x97c6[62]](204)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[95]]= function(_0x86bfx12,_0x86bfx13){return MailRoom[_0x97c6[94]]({where:{id:_0x86bfx12[_0x97c6[24]][_0x97c6[96]]},individualHooks:true})[_0x97c6[23]](function(){return _0x86bfx13[_0x97c6[62]](200)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};exports[_0x97c6[97]]= function(_0x86bfx12,_0x86bfx13){return sequelize[_0x97c6[24]](_0x97c6[100],{type:sequelize[_0x97c6[53]][_0x97c6[52]]})[_0x97c6[23]](function(_0x86bfx25){var _0x86bfx26=_[_0x97c6[40]]({new:0,open:0,pending:0,closed:0},_[_0x97c6[99]](_[_0x97c6[98]](_0x86bfx25,_0x97c6[22]),_0x97c6[41]));return _0x86bfx13[_0x97c6[22]](200)[_0x97c6[21]](_0x86bfx26)})[_0x97c6[20]](function(_0x86bfx15){return handleError(_0x86bfx13,_0x86bfx15)})};function handleError(_0x86bfx13,_0x86bfx15){logger[_0x97c6[102]](_0x86bfx15[_0x97c6[101]]);return _0x86bfx13[_0x97c6[22]](500)[_0x97c6[21]](_0x86bfx15)}
\ No newline at end of file