986896ec2cd6341449afb1785d789049eb6ae9cb
[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 _0x77ca=['nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString','verify','Not\x20verifired','exports'];(function(_0x16eadc,_0x3fc953){var _0x5b05c8=function(_0xd8b9cf){while(--_0xd8b9cf){_0x16eadc['push'](_0x16eadc['shift']());}};_0x5b05c8(++_0x3fc953);}(_0x77ca,0xbb));var _0xa77c=function(_0x114e95,_0x5ef65c){_0x114e95=_0x114e95-0x0;var _0x45d249=_0x77ca[_0x114e95];return _0x45d249;};'use strict';var nodemailer=require(_0xa77c('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xa77c('0x1'));function EmailSmtp(){}EmailSmtp[_0xa77c('0x2')][_0xa77c('0x3')]=function(_0x35e6a6,_0x3de3d2){return new BPromise(function(_0x6967c,_0x33ad03){var _0x10c54f=nodemailer[_0xa77c('0x4')](_0x35e6a6);_0x10c54f['use'](_0xa77c('0x5'),inlineBase64());_0x10c54f[_0xa77c('0x6')](_0x3de3d2,function(_0x76c3a7,_0x4789c3){if(_0x76c3a7){_0x33ad03(_0x76c3a7[_0xa77c('0x7')]());}else{_0x6967c(_0x4789c3);}});});};EmailSmtp[_0xa77c('0x2')][_0xa77c('0x8')]=function(_0x3420bd){return new BPromise(function(_0x1aae94,_0x10fff9){var _0x169ff1=nodemailer['createTransport'](_0x3420bd);_0x169ff1[_0xa77c('0x8')](function(_0xba4bbe,_0x181c29){if(_0xba4bbe){_0x10fff9(_0xba4bbe[_0xa77c('0x7')]());}else{if(_0x181c29){_0x1aae94(_0x181c29);}else{_0x10fff9(_0xa77c('0x9'));}}});});};module[_0xa77c('0xa')]=EmailSmtp;