Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / routing / mailRpc / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xeec9=['request','then','error','message','result','sendMailMessage','SendMail','bluebird','http'];(function(_0x22d0b5,_0x26b6ca){var _0xa6cc2b=function(_0x187c67){while(--_0x187c67){_0x22d0b5['push'](_0x22d0b5['shift']());}};_0xa6cc2b(++_0x26b6ca);}(_0xeec9,0x127));var _0x9eec=function(_0xf49ce2,_0x406c6f){_0xf49ce2=_0xf49ce2-0x0;var _0x970f=_0xeec9[_0xf49ce2];return _0x970f;};'use strict';var BPromise=require(_0x9eec('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9eec('0x1')]({'port':0x232b});function request(_0x26a66a,_0x1e92b8){return new BPromise(function(_0x5b1db6,_0x1252da){return client[_0x9eec('0x2')](_0x26a66a,_0x1e92b8)[_0x9eec('0x3')](function(_0x304247){if(_0x304247[_0x9eec('0x4')]){return _0x1252da(_0x304247['error'][_0x9eec('0x5')]);}else{return _0x5b1db6(_0x304247[_0x9eec('0x6')]);}})['catch'](function(_0x442e7c){return _0x1252da(_0x442e7c);});});}exports[_0x9eec('0x7')]=function(_0x10daa3,_0x5e7520){return request(_0x9eec('0x8'),{'account':_0x10daa3,'message':_0x5e7520});};