Built motion from commit 746c7d2a.|2.5.35
[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 _0x038a=['exports','nodemailer','nodemailer-plugin-inline-base64','send','use','compile','sendMail','toString','prototype','verify','createTransport','Not\x20verifired'];(function(_0x3d9a94,_0x518fc2){var _0x21ca25=function(_0x12cd3d){while(--_0x12cd3d){_0x3d9a94['push'](_0x3d9a94['shift']());}};_0x21ca25(++_0x518fc2);}(_0x038a,0x1b1));var _0xa038=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x038a[_0x1ad926];return _0x1b81dc;};'use strict';var nodemailer=require(_0xa038('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xa038('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xa038('0x2')]=function(_0x1e2775,_0x56114e){return new BPromise(function(_0x23c235,_0x5ce186){var _0x1bfd78=nodemailer['createTransport'](_0x1e2775);_0x1bfd78[_0xa038('0x3')](_0xa038('0x4'),inlineBase64());_0x1bfd78[_0xa038('0x5')](_0x56114e,function(_0x4870e6,_0x1e7dc5){if(_0x4870e6){_0x5ce186(_0x4870e6[_0xa038('0x6')]());}else{_0x23c235(_0x1e7dc5);}});});};EmailSmtp[_0xa038('0x7')][_0xa038('0x8')]=function(_0x3e8917){return new BPromise(function(_0x1ceead,_0x126b32){var _0x503575=nodemailer[_0xa038('0x9')](_0x3e8917);_0x503575[_0xa038('0x8')](function(_0x1a9a29,_0x4791b4){if(_0x1a9a29){_0x126b32(_0x1a9a29['toString']());}else{if(_0x4791b4){_0x1ceead(_0x4791b4);}else{_0x126b32(_0xa038('0xa'));}}});});};module[_0xa038('0xb')]=EmailSmtp;