fa378577cbc491cf2b8c2e728545f4f52fe38585
[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 _0x5fac=['nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','toString','prototype','verify','nodemailer'];(function(_0x5a4c9b,_0x44cb19){var _0x37fbdb=function(_0x1bfcbe){while(--_0x1bfcbe){_0x5a4c9b['push'](_0x5a4c9b['shift']());}};_0x37fbdb(++_0x44cb19);}(_0x5fac,0x1d5));var _0xc5fa=function(_0x5c1c94,_0x389042){_0x5c1c94=_0x5c1c94-0x0;var _0x2b016d=_0x5fac[_0x5c1c94];return _0x2b016d;};'use strict';var nodemailer=require(_0xc5fa('0x0'));var inlineBase64=require(_0xc5fa('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xc5fa('0x2')]=function(_0x41c7b2,_0x1c63c4){return new Promise(function(_0x6fccf7,_0x27379e){var _0x186fb2=nodemailer[_0xc5fa('0x3')](_0x41c7b2);_0x186fb2[_0xc5fa('0x4')](_0xc5fa('0x5'),inlineBase64());_0x186fb2[_0xc5fa('0x6')](_0x1c63c4,function(_0x3444c2,_0x24fe24){if(_0x3444c2){_0x27379e(_0x3444c2[_0xc5fa('0x7')]());}else{_0x6fccf7(_0x24fe24);}});});};EmailSmtp[_0xc5fa('0x8')][_0xc5fa('0x9')]=function(_0x4f702d){return new Promise(function(_0x35913e,_0x33f748){var _0x4739f1=nodemailer['createTransport'](_0x4f702d);_0x4739f1['verify'](function(_0x5dd76c,_0x26b057){if(_0x5dd76c){_0x33f748(_0x5dd76c[_0xc5fa('0x7')]());}else{if(_0x26b057){_0x35913e(_0x26b057);}else{_0x33f748('Not\x20verifired');}}});});};module['exports']=EmailSmtp;