Built motion from commit c0cdc9d8.|2.6.28
[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 _0x05e3=['http','error','message','result','sendMailMessage','SendMail','bluebird'];(function(_0x15260f,_0x5eef15){var _0x56ce05=function(_0x27ae7f){while(--_0x27ae7f){_0x15260f['push'](_0x15260f['shift']());}};_0x56ce05(++_0x5eef15);}(_0x05e3,0x180));var _0x305e=function(_0x12a57d,_0x738bd1){_0x12a57d=_0x12a57d-0x0;var _0x4b26f6=_0x05e3[_0x12a57d];return _0x4b26f6;};'use strict';var BPromise=require(_0x305e('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x305e('0x1')]({'port':0x232b});function request(_0x40ca51,_0x10be03){return new BPromise(function(_0x3dbd5d,_0x593b5f){return client['request'](_0x40ca51,_0x10be03)['then'](function(_0x22c31f){if(_0x22c31f[_0x305e('0x2')]){return _0x593b5f(_0x22c31f[_0x305e('0x2')][_0x305e('0x3')]);}else{return _0x3dbd5d(_0x22c31f[_0x305e('0x4')]);}})['catch'](function(_0x1d65f6){return _0x593b5f(_0x1d65f6);});});}exports[_0x305e('0x5')]=function(_0x3e6abe,_0x8928f1){return request(_0x305e('0x6'),{'account':_0x3e6abe,'message':_0x8928f1});};