Built motion from commit f3da74b7.|2.5.36
[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 _0xbf29=['compile','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x3e9800,_0x54ec64){var _0x31d038=function(_0x568420){while(--_0x568420){_0x3e9800['push'](_0x3e9800['shift']());}};_0x31d038(++_0x54ec64);}(_0xbf29,0x12e));var _0x9bf2=function(_0x535e73,_0x5d397f){_0x535e73=_0x535e73-0x0;var _0x316665=_0xbf29[_0x535e73];return _0x316665;};'use strict';var nodemailer=require(_0x9bf2('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x9bf2('0x1'));function EmailSmtp(){}EmailSmtp[_0x9bf2('0x2')][_0x9bf2('0x3')]=function(_0x9321d1,_0x3476c8){return new BPromise(function(_0x13cc30,_0x1be65c){var _0x241068=nodemailer[_0x9bf2('0x4')](_0x9321d1);_0x241068[_0x9bf2('0x5')](_0x9bf2('0x6'),inlineBase64());_0x241068['sendMail'](_0x3476c8,function(_0x2d8873,_0xf41fc0){if(_0x2d8873){_0x1be65c(_0x2d8873[_0x9bf2('0x7')]());}else{_0x13cc30(_0xf41fc0);}});});};EmailSmtp['prototype'][_0x9bf2('0x8')]=function(_0x36a8d9){return new BPromise(function(_0x1ad475,_0x4b5f16){var _0x1bcd2d=nodemailer[_0x9bf2('0x4')](_0x36a8d9);_0x1bcd2d[_0x9bf2('0x8')](function(_0x90d426,_0x51d611){if(_0x90d426){_0x4b5f16(_0x90d426[_0x9bf2('0x7')]());}else{if(_0x51d611){_0x1ad475(_0x51d611);}else{_0x4b5f16(_0x9bf2('0x9'));}}});});};module[_0x9bf2('0xa')]=EmailSmtp;