25c212c705e28c6c132102e119875e4870bd6fe7
[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 _0x3e28=['SendMail','jayson/promise','client','request','then','error','message','result','catch','sendMailMessage'];(function(_0x5cfd35,_0x245a8f){var _0x1e8ab9=function(_0x461520){while(--_0x461520){_0x5cfd35['push'](_0x5cfd35['shift']());}};_0x1e8ab9(++_0x245a8f);}(_0x3e28,0x1a5));var _0x83e2=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x3e28[_0x2070da];return _0x4f9fe1;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x83e2('0x0'));var client=jayson[_0x83e2('0x1')]['http']({'port':0x232b});function request(_0x3c0baf,_0x1ad04b){return new BPromise(function(_0x336b8f,_0x146ec1){return client[_0x83e2('0x2')](_0x3c0baf,_0x1ad04b)[_0x83e2('0x3')](function(_0x69afcc){if(_0x69afcc['error']){return _0x146ec1(_0x69afcc[_0x83e2('0x4')][_0x83e2('0x5')]);}else{return _0x336b8f(_0x69afcc[_0x83e2('0x6')]);}})[_0x83e2('0x7')](function(_0x2319f9){return _0x146ec1(_0x2319f9);});});}exports[_0x83e2('0x8')]=function(_0x28439f,_0x2ece14){return request(_0x83e2('0x9'),{'account':_0x28439f,'message':_0x2ece14});};