5bc2ff7ea5f8950d1a35e45acb0b527bcf2ab8d2
[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 _0x0a55=['compile','sendMail','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport','use'];(function(_0x5f1a6a,_0x3cac07){var _0x3c8568=function(_0x525698){while(--_0x525698){_0x5f1a6a['push'](_0x5f1a6a['shift']());}};_0x3c8568(++_0x3cac07);}(_0x0a55,0x1a7));var _0x50a5=function(_0x37c4af,_0x3295b7){_0x37c4af=_0x37c4af-0x0;var _0x54aa05=_0x0a55[_0x37c4af];return _0x54aa05;};'use strict';var nodemailer=require(_0x50a5('0x0'));var BPromise=require(_0x50a5('0x1'));var inlineBase64=require(_0x50a5('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x50a5('0x3')]=function(_0x4e4152,_0x14072f){return new BPromise(function(_0x4e8995,_0xaf4797){var _0x1eecd0=nodemailer[_0x50a5('0x4')](_0x4e4152);_0x1eecd0[_0x50a5('0x5')](_0x50a5('0x6'),inlineBase64());_0x1eecd0[_0x50a5('0x7')](_0x14072f,function(_0x1dbfbe,_0x5c0c72){if(_0x1dbfbe){_0xaf4797(_0x1dbfbe['toString']());}else{_0x4e8995(_0x5c0c72);}});});};EmailSmtp['prototype']['verify']=function(_0x2c824f){return new BPromise(function(_0x4fe7d0,_0x4483fd){var _0x474669=nodemailer[_0x50a5('0x4')](_0x2c824f);_0x474669[_0x50a5('0x8')](function(_0x5ed1fa,_0x35ffe6){if(_0x5ed1fa){_0x4483fd(_0x5ed1fa['toString']());}else{if(_0x35ffe6){_0x4fe7d0(_0x35ffe6);}else{_0x4483fd(_0x50a5('0x9'));}}});});};module[_0x50a5('0xa')]=EmailSmtp;