d46db9371b5dabeebb7b1ca67c600b84a82be98b
[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 _0xef34=['verify','Not\x20verifired','exports','nodemailer','bluebird','prototype','send','createTransport','use','sendMail','toString'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xef34,0x1f2));var _0x4ef3=function(_0x2f75d1,_0x38f249){_0x2f75d1=_0x2f75d1-0x0;var _0x4eefbf=_0xef34[_0x2f75d1];return _0x4eefbf;};'use strict';var nodemailer=require(_0x4ef3('0x0'));var BPromise=require(_0x4ef3('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x4ef3('0x2')][_0x4ef3('0x3')]=function(_0x3af7de,_0x498ef7){return new BPromise(function(_0xcea39f,_0x29e8e6){var _0xe886e7=nodemailer[_0x4ef3('0x4')](_0x3af7de);_0xe886e7[_0x4ef3('0x5')]('compile',inlineBase64());_0xe886e7[_0x4ef3('0x6')](_0x498ef7,function(_0x242ba0,_0x53cfd2){if(_0x242ba0){_0x29e8e6(_0x242ba0[_0x4ef3('0x7')]());}else{_0xcea39f(_0x53cfd2);}});});};EmailSmtp['prototype'][_0x4ef3('0x8')]=function(_0x3152d6){return new BPromise(function(_0x34e75f,_0x3241c3){var _0x551589=nodemailer[_0x4ef3('0x4')](_0x3152d6);_0x551589[_0x4ef3('0x8')](function(_0x385ebf,_0x112fed){if(_0x385ebf){_0x3241c3(_0x385ebf[_0x4ef3('0x7')]());}else{if(_0x112fed){_0x34e75f(_0x112fed);}else{_0x3241c3(_0x4ef3('0x9'));}}});});};module[_0x4ef3('0xa')]=EmailSmtp;