Built motion from commit (unavailable).|2.5.27
[motion2.git] / server / services / email / lib / smtp.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 _0xfdaf=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString','verify','Not\x20verifired','exports','nodemailer'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0xfdaf,0x1d8));var _0xffda=function(_0x2c26e9,_0x42270e){_0x2c26e9=_0x2c26e9-0x0;var _0x20ebe9=_0xfdaf[_0x2c26e9];return _0x20ebe9;};'use strict';var nodemailer=require(_0xffda('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xffda('0x1'));function EmailSmtp(){}EmailSmtp[_0xffda('0x2')][_0xffda('0x3')]=function(_0x297e51,_0x47af71){return new BPromise(function(_0xd3d187,_0x4bdbd1){var _0x2a7c46=nodemailer[_0xffda('0x4')](_0x297e51);_0x2a7c46[_0xffda('0x5')](_0xffda('0x6'),inlineBase64());_0x2a7c46['sendMail'](_0x47af71,function(_0x1de442,_0x8d05c){if(_0x1de442){_0x4bdbd1(_0x1de442[_0xffda('0x7')]());}else{_0xd3d187(_0x8d05c);}});});};EmailSmtp['prototype'][_0xffda('0x8')]=function(_0x36717a){return new BPromise(function(_0x2a6a76,_0x499638){var _0x3e3875=nodemailer[_0xffda('0x4')](_0x36717a);_0x3e3875['verify'](function(_0x4601ca,_0x1f0c84){if(_0x4601ca){_0x499638(_0x4601ca['toString']());}else{if(_0x1f0c84){_0x2a6a76(_0x1f0c84);}else{_0x499638(_0xffda('0x9'));}}});});};module[_0xffda('0xa')]=EmailSmtp;