4c2d57d8fc07a54412c22e6cb271d4ac6879cfcf
[motion2.git] / server / services / agi / 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 _0x0c08=['message','sendMailMessage','SendMail','jayson/promise','client','http','then','error'];(function(_0x2b5562,_0x1f19a9){var _0x2df87a=function(_0x300a92){while(--_0x300a92){_0x2b5562['push'](_0x2b5562['shift']());}};_0x2df87a(++_0x1f19a9);}(_0x0c08,0x193));var _0x80c0=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0x0c08[_0x86c6cb];return _0x1b1592;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x80c0('0x0'));var client=jayson[_0x80c0('0x1')][_0x80c0('0x2')]({'port':0x232b});function request(_0x5b94f9,_0x52ca2b){return new BPromise(function(_0x8d7535,_0x3ebc7e){return client['request'](_0x5b94f9,_0x52ca2b)[_0x80c0('0x3')](function(_0x292339){if(_0x292339['error']){return _0x3ebc7e(_0x292339[_0x80c0('0x4')][_0x80c0('0x5')]);}else{return _0x8d7535(_0x292339['result']);}})['catch'](function(_0x3edbd5){return _0x3ebc7e(_0x3edbd5);});});}exports[_0x80c0('0x6')]=function(_0x3bf046,_0x4d611d){return request(_0x80c0('0x7'),{'account':_0x3bf046,'message':_0x4d611d});};