4ca264fc6bea2a61ff0ce0a05160bdfef2fa7a88
[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 _0x9c7b=['nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString','verify','exports','nodemailer','bluebird'];(function(_0x4d3f7b,_0x4d0a95){var _0x137115=function(_0x5b05a0){while(--_0x5b05a0){_0x4d3f7b['push'](_0x4d3f7b['shift']());}};_0x137115(++_0x4d0a95);}(_0x9c7b,0xda));var _0xb9c7=function(_0x904517,_0x42677c){_0x904517=_0x904517-0x0;var _0x89c92d=_0x9c7b[_0x904517];return _0x89c92d;};'use strict';var nodemailer=require(_0xb9c7('0x0'));var BPromise=require(_0xb9c7('0x1'));var inlineBase64=require(_0xb9c7('0x2'));function EmailSmtp(){}EmailSmtp[_0xb9c7('0x3')][_0xb9c7('0x4')]=function(_0x1de9c6,_0x49bc13){return new BPromise(function(_0x2d8bf3,_0x48f49e){var _0x4f34b1=nodemailer[_0xb9c7('0x5')](_0x1de9c6);_0x4f34b1['use'](_0xb9c7('0x6'),inlineBase64());_0x4f34b1[_0xb9c7('0x7')](_0x49bc13,function(_0x455e56,_0x148c3c){if(_0x455e56){_0x48f49e(_0x455e56[_0xb9c7('0x8')]());}else{_0x2d8bf3(_0x148c3c);}});});};EmailSmtp[_0xb9c7('0x3')][_0xb9c7('0x9')]=function(_0x305638){return new BPromise(function(_0xde3ae0,_0x308a96){var _0x9037d3=nodemailer[_0xb9c7('0x5')](_0x305638);_0x9037d3[_0xb9c7('0x9')](function(_0xcfc4db,_0x505f30){if(_0xcfc4db){_0x308a96(_0xcfc4db[_0xb9c7('0x8')]());}else{if(_0x505f30){_0xde3ae0(_0x505f30);}else{_0x308a96('Not\x20verifired');}}});});};module[_0xb9c7('0xa')]=EmailSmtp;