Built motion from commit d6d69adf.|2.6.33
[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 _0x9fc9=['request','then','message','sendMailMessage','SendMail','jayson/promise','client','http'];(function(_0x3621d2,_0x57a5e7){var _0x3ff0e9=function(_0x5b1b97){while(--_0x5b1b97){_0x3621d2['push'](_0x3621d2['shift']());}};_0x3ff0e9(++_0x57a5e7);}(_0x9fc9,0x6d));var _0x99fc=function(_0x27f4d8,_0x13ca36){_0x27f4d8=_0x27f4d8-0x0;var _0x181c9b=_0x9fc9[_0x27f4d8];return _0x181c9b;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x99fc('0x0'));var client=jayson[_0x99fc('0x1')][_0x99fc('0x2')]({'port':0x232b});function request(_0xfedff0,_0xa9799b){return new BPromise(function(_0x1dbabb,_0x5c0c52){return client[_0x99fc('0x3')](_0xfedff0,_0xa9799b)[_0x99fc('0x4')](function(_0x49012d){if(_0x49012d['error']){return _0x5c0c52(_0x49012d['error'][_0x99fc('0x5')]);}else{return _0x1dbabb(_0x49012d['result']);}})['catch'](function(_0x45a874){return _0x5c0c52(_0x45a874);});});}exports[_0x99fc('0x6')]=function(_0xa4b7da,_0x558b12){return request(_0x99fc('0x7'),{'account':_0xa4b7da,'message':_0x558b12});};