Built motion from commit 4ca75f1b.|2.6.28
[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 _0x5a30=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','toString'];(function(_0x4c0ca7,_0x267486){var _0x198a33=function(_0xd3c479){while(--_0xd3c479){_0x4c0ca7['push'](_0x4c0ca7['shift']());}};_0x198a33(++_0x267486);}(_0x5a30,0x17f));var _0x05a3=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x5a30[_0x5eb22e];return _0x27fed5;};'use strict';var nodemailer=require(_0x05a3('0x0'));var inlineBase64=require(_0x05a3('0x1'));function EmailSmtp(){}EmailSmtp[_0x05a3('0x2')][_0x05a3('0x3')]=function(_0x17b9b5,_0x3dace3){return new Promise(function(_0xd5126f,_0x1bd9b0){var _0x32d00e=nodemailer[_0x05a3('0x4')](_0x17b9b5);_0x32d00e[_0x05a3('0x5')]('compile',inlineBase64());_0x32d00e['sendMail'](_0x3dace3,function(_0x30d908,_0xcea895){if(_0x30d908){_0x1bd9b0(_0x30d908[_0x05a3('0x6')]());}else{_0xd5126f(_0xcea895);}});});};EmailSmtp[_0x05a3('0x2')][_0x05a3('0x7')]=function(_0x4e5d64){return new Promise(function(_0x18fe77,_0x3855e8){var _0x3c485e=nodemailer['createTransport'](_0x4e5d64);_0x3c485e[_0x05a3('0x7')](function(_0x9ab8d8,_0x2471d8){if(_0x9ab8d8){_0x3855e8(_0x9ab8d8[_0x05a3('0x6')]());}else{if(_0x2471d8){_0x18fe77(_0x2471d8);}else{_0x3855e8(_0x05a3('0x8'));}}});});};module[_0x05a3('0x9')]=EmailSmtp;