Built motion from commit 52def3a.|0.0.67
[motion.git] / server / api / mail_server_out / mail_server_out.controller.js
1 var _0x26e1=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x69\x6E\x64\x65\x78\x53\x65\x72\x76\x69\x63\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x74\x65\x73\x74","\x65\x72\x72\x6F\x72","\x72\x6F\x6C\x6C\x62\x61\x63\x6B","\x45\x52\x52\x4F\x52","\x63\x6F\x6D\x6D\x69\x74","\x43\x4F\x4E\x4E\x45\x43\x54\x45\x44","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x20","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x20\x74\x65\x73\x74\x2E\x2E","\x75\x73\x65\x72","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E"];_0x26e1[0];var _=require(_0x26e1[1]);var MailServerOut=require(_0x26e1[3])[_0x26e1[2]];var MailMessage=require(_0x26e1[3])[_0x26e1[4]];var sequelize=require(_0x26e1[3])[_0x26e1[5]];exports[_0x26e1[6]]=function(_0x3f94x5,_0x3f94x6){return MailServerOut[_0x26e1[11]]()[_0x26e1[10]](function(_0x3f94x8){return _0x3f94x6[_0x26e1[9]](200)[_0x26e1[8]](_0x3f94x8)})[_0x26e1[7]](function(_0x3f94x7){return handleError(_0x3f94x6,_0x3f94x7)})};exports[_0x26e1[12]]=function(_0x3f94x5,_0x3f94x6){return MailServerOut[_0x26e1[13]]({where:{service:true}})[_0x26e1[10]](function(_0x3f94x9){return _0x3f94x6[_0x26e1[9]](200)[_0x26e1[8]](_0x3f94x9)})[_0x26e1[7]](function(_0x3f94x7){return handleError(_0x3f94x6,_0x3f94x7)})};exports[_0x26e1[14]]=function(_0x3f94x5,_0x3f94x6){return MailServerOut[_0x26e1[18]](_0x3f94x5[_0x26e1[17]][_0x26e1[16]])[_0x26e1[10]](function(_0x3f94x9){if(!_0x3f94x9){return _0x3f94x6[_0x26e1[15]](404)};return _0x3f94x6[_0x26e1[8]](_0x3f94x9)})[_0x26e1[7]](function(_0x3f94x7){return handleError(_0x3f94x6,_0x3f94x7)})};exports[_0x26e1[19]]=function(_0x3f94x5,_0x3f94x6){return MailServerOut[_0x26e1[19]](_0x3f94x5[_0x26e1[20]])[_0x26e1[10]](function(_0x3f94x9){return _0x3f94x6[_0x26e1[9]](201)[_0x26e1[8]](_0x3f94x9)})[_0x26e1[7]](function(_0x3f94x7){return handleError(_0x3f94x6,_0x3f94x7)})};exports[_0x26e1[21]]=function(_0x3f94x5,_0x3f94x6){if(_0x3f94x5[_0x26e1[20]][_0x26e1[16]]){delete _0x3f94x5[_0x26e1[20]][_0x26e1[16]]};return MailServerOut[_0x26e1[18]](_0x3f94x5[_0x26e1[17]][_0x26e1[16]])[_0x26e1[10]](function(_0x3f94x9){if(!_0x3f94x9){return _0x3f94x6[_0x26e1[15]](404)};var _0x3f94xa=_[_0x26e1[22]](_0x3f94x9,_0x3f94x5[_0x26e1[20]]);return _0x3f94xa[_0x26e1[23]]()})[_0x26e1[10]](function(_0x3f94x9){return _0x3f94x6[_0x26e1[9]](200)[_0x26e1[8]](_0x3f94x9)})[_0x26e1[7]](function(_0x3f94x7){return handleError(_0x3f94x6,_0x3f94x7)})};exports[_0x26e1[24]]=function(_0x3f94x5,_0x3f94x6){return MailServerOut[_0x26e1[18]](_0x3f94x5[_0x26e1[17]][_0x26e1[16]])[_0x26e1[10]](function(_0x3f94x9){if(!_0x3f94x9){return _0x3f94x6[_0x26e1[15]](404)};return _0x3f94x9[_0x26e1[24]]()})[_0x26e1[10]](function(){return _0x3f94x6[_0x26e1[15]](204)})[_0x26e1[7]](function(_0x3f94x7){return handleError(_0x3f94x6,_0x3f94x7)})};exports[_0x26e1[25]]=function(_0x3f94x5,_0x3f94x6){return sequelize[_0x26e1[35]]()[_0x26e1[10]](function(_0x3f94xb){var _0x3f94xc;var _0x3f94xd;return MailServerOut[_0x26e1[18]](_0x3f94x5[_0x26e1[17]][_0x26e1[16]])[_0x26e1[10]](function(_0x3f94x9){if(!_0x3f94x9){_0x3f94xb[_0x26e1[27]]();return _0x3f94x6[_0x26e1[15]](404)}else {return _0x3f94x9}})[_0x26e1[10]](function(_0x3f94x9){_0x3f94xc=_0x3f94x9;return MailMessage[_0x26e1[19]]({subject:_0x26e1[31]+_0x3f94x9[_0x26e1[32]]+_0x26e1[33],text:_0x26e1[31]+_0x3f94x9[_0x26e1[32]]+_0x26e1[33],from:[_0x3f94x9[_0x26e1[32]]],to:[_0x3f94x9[_0x26e1[32]]]},{transaction:_0x3f94xb,user:_0x3f94x5[_0x26e1[34]]})})[_0x26e1[10]](function(_0x3f94xe){_0x3f94xd=_0x3f94xe;return _0x3f94xc[_0x26e1[21]]({state:_0x26e1[30]})})[_0x26e1[10]](function(){_0x3f94xb[_0x26e1[29]]();return _0x3f94x6[_0x26e1[9]](201)[_0x26e1[8]](_0x3f94xd)})[_0x26e1[7]](function(_0x3f94x7){console[_0x26e1[26]](_0x3f94x7);_0x3f94xb[_0x26e1[27]]();return _0x3f94xc[_0x26e1[21]]({state:_0x26e1[28]})[_0x26e1[10]](function(){return handleError(_0x3f94x6,_0x3f94x7)})})})};function handleError(_0x3f94x6,_0x3f94x7){return _0x3f94x6[_0x26e1[9]](500)[_0x26e1[8]](_0x3f94x7)}