Built motion from commit 936e8062.|2.5.33
[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 _0xef32=['Not\x20verifired','exports','nodemailer','bluebird','prototype','use','compile','sendMail','verify','toString'];(function(_0x1dfcf5,_0x157a68){var _0x561955=function(_0x48688d){while(--_0x48688d){_0x1dfcf5['push'](_0x1dfcf5['shift']());}};_0x561955(++_0x157a68);}(_0xef32,0x192));var _0x2ef3=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xef32[_0x5ddb1c];return _0x354adc;};'use strict';var nodemailer=require(_0x2ef3('0x0'));var BPromise=require(_0x2ef3('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x2ef3('0x2')]['send']=function(_0x5deb21,_0x3b9ab3){return new BPromise(function(_0x23067a,_0x41964f){var _0xbc4a06=nodemailer['createTransport'](_0x5deb21);_0xbc4a06[_0x2ef3('0x3')](_0x2ef3('0x4'),inlineBase64());_0xbc4a06[_0x2ef3('0x5')](_0x3b9ab3,function(_0x12a94f,_0x4e7b70){if(_0x12a94f){_0x41964f(_0x12a94f['toString']());}else{_0x23067a(_0x4e7b70);}});});};EmailSmtp[_0x2ef3('0x2')][_0x2ef3('0x6')]=function(_0x12c3bb){return new BPromise(function(_0x1500c7,_0x3e8fe){var _0x2d48ad=nodemailer['createTransport'](_0x12c3bb);_0x2d48ad[_0x2ef3('0x6')](function(_0xf559a7,_0x52cdc2){if(_0xf559a7){_0x3e8fe(_0xf559a7[_0x2ef3('0x7')]());}else{if(_0x52cdc2){_0x1500c7(_0x52cdc2);}else{_0x3e8fe(_0x2ef3('0x8'));}}});});};module[_0x2ef3('0x9')]=EmailSmtp;