Built motion from commit f57cc866.|2.6.31
[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 _0x215e=['SendMail','bluebird','jayson/promise','client','http','request','then','error','message','sendMailMessage'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x215e,0x17d));var _0xe215=function(_0xf64630,_0x49a48b){_0xf64630=_0xf64630-0x0;var _0x206ea9=_0x215e[_0xf64630];return _0x206ea9;};'use strict';var BPromise=require(_0xe215('0x0'));var jayson=require(_0xe215('0x1'));var client=jayson[_0xe215('0x2')][_0xe215('0x3')]({'port':0x232b});function request(_0x359d11,_0x216f23){return new BPromise(function(_0x5539b4,_0x5c82b7){return client[_0xe215('0x4')](_0x359d11,_0x216f23)[_0xe215('0x5')](function(_0x427503){if(_0x427503[_0xe215('0x6')]){return _0x5c82b7(_0x427503['error'][_0xe215('0x7')]);}else{return _0x5539b4(_0x427503['result']);}})['catch'](function(_0x19c74e){return _0x5c82b7(_0x19c74e);});});}exports[_0xe215('0x8')]=function(_0x598ab4,_0x2a2019){return request(_0xe215('0x9'),{'account':_0x598ab4,'message':_0x2a2019});};