30f8de1f29c6cd22a6e04ac1d162419e9d5bb990
[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 _0x2aa5=['send','createTransport','compile','sendMail','verify','toString','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype'];(function(_0x19f582,_0x58d55b){var _0x18d541=function(_0x1b9a43){while(--_0x1b9a43){_0x19f582['push'](_0x19f582['shift']());}};_0x18d541(++_0x58d55b);}(_0x2aa5,0x10f));var _0x52aa=function(_0x1b2eed,_0x171e94){_0x1b2eed=_0x1b2eed-0x0;var _0x528608=_0x2aa5[_0x1b2eed];return _0x528608;};'use strict';var nodemailer=require(_0x52aa('0x0'));var BPromise=require(_0x52aa('0x1'));var inlineBase64=require(_0x52aa('0x2'));function EmailSmtp(){}EmailSmtp[_0x52aa('0x3')][_0x52aa('0x4')]=function(_0x1155ae,_0x18c9bc){return new BPromise(function(_0x342a5c,_0x45098b){var _0x5cc4dd=nodemailer[_0x52aa('0x5')](_0x1155ae);_0x5cc4dd['use'](_0x52aa('0x6'),inlineBase64());_0x5cc4dd[_0x52aa('0x7')](_0x18c9bc,function(_0x17447f,_0x358f01){if(_0x17447f){_0x45098b(_0x17447f['toString']());}else{_0x342a5c(_0x358f01);}});});};EmailSmtp['prototype'][_0x52aa('0x8')]=function(_0x4c5bf8){return new BPromise(function(_0x457c8b,_0x2f4ba5){var _0x1848da=nodemailer[_0x52aa('0x5')](_0x4c5bf8);_0x1848da['verify'](function(_0x1627bf,_0x15e54d){if(_0x1627bf){_0x2f4ba5(_0x1627bf[_0x52aa('0x9')]());}else{if(_0x15e54d){_0x457c8b(_0x15e54d);}else{_0x2f4ba5('Not\x20verifired');}}});});};module[_0x52aa('0xa')]=EmailSmtp;