Built motion from commit 19a84241.|2.5.34
[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 _0x1f8b=['send','use','compile','sendMail','verify','createTransport','toString','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x3fbdac,_0x1f2ecd){var _0x3938f2=function(_0x2b572e){while(--_0x2b572e){_0x3fbdac['push'](_0x3fbdac['shift']());}};_0x3938f2(++_0x1f2ecd);}(_0x1f8b,0x152));var _0xb1f8=function(_0x3a167f,_0x62b142){_0x3a167f=_0x3a167f-0x0;var _0x2fcfc9=_0x1f8b[_0x3a167f];return _0x2fcfc9;};'use strict';var nodemailer=require(_0xb1f8('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xb1f8('0x1'));function EmailSmtp(){}EmailSmtp[_0xb1f8('0x2')][_0xb1f8('0x3')]=function(_0x390a2d,_0xd59d36){return new BPromise(function(_0x58bd73,_0xb07774){var _0x4a1ccb=nodemailer['createTransport'](_0x390a2d);_0x4a1ccb[_0xb1f8('0x4')](_0xb1f8('0x5'),inlineBase64());_0x4a1ccb[_0xb1f8('0x6')](_0xd59d36,function(_0x57626e,_0x180c73){if(_0x57626e){_0xb07774(_0x57626e['toString']());}else{_0x58bd73(_0x180c73);}});});};EmailSmtp[_0xb1f8('0x2')][_0xb1f8('0x7')]=function(_0x466435){return new BPromise(function(_0x455165,_0x400378){var _0x136db2=nodemailer[_0xb1f8('0x8')](_0x466435);_0x136db2[_0xb1f8('0x7')](function(_0x2f787e,_0x1ebe6d){if(_0x2f787e){_0x400378(_0x2f787e[_0xb1f8('0x9')]());}else{if(_0x1ebe6d){_0x455165(_0x1ebe6d);}else{_0x400378(_0xb1f8('0xa'));}}});});};module['exports']=EmailSmtp;