5e82be150ce2d0ed9eb71478165f6bb8dea0c8bb
[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 _0x0791=['request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0x471995,_0x49196a){var _0x363c1c=function(_0x47a62d){while(--_0x47a62d){_0x471995['push'](_0x471995['shift']());}};_0x363c1c(++_0x49196a);}(_0x0791,0x97));var _0x1079=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x0791[_0x3b2369];return _0x5a1367;};'use strict';var BPromise=require(_0x1079('0x0'));var jayson=require(_0x1079('0x1'));var client=jayson['client'][_0x1079('0x2')]({'port':0x232b});function request(_0x2d9fcc,_0x29bbb0){return new BPromise(function(_0x3e0725,_0x1a0cfa){return client[_0x1079('0x3')](_0x2d9fcc,_0x29bbb0)[_0x1079('0x4')](function(_0x5a667e){if(_0x5a667e['error']){return _0x1a0cfa(_0x5a667e[_0x1079('0x5')][_0x1079('0x6')]);}else{return _0x3e0725(_0x5a667e[_0x1079('0x7')]);}})[_0x1079('0x8')](function(_0x4e24a6){return _0x1a0cfa(_0x4e24a6);});});}exports[_0x1079('0x9')]=function(_0x5d3e20,_0x4f0cd6){return request(_0x1079('0xa'),{'account':_0x5d3e20,'message':_0x4f0cd6});};