ce03244326191922ae73d412bec14745871eec89
[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 _0x05fe=['verify','Not\x20verifired','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x4cfcc9,_0x150040){var _0x201279=function(_0x3d1c5e){while(--_0x3d1c5e){_0x4cfcc9['push'](_0x4cfcc9['shift']());}};_0x201279(++_0x150040);}(_0x05fe,0x115));var _0xe05f=function(_0x4b35de,_0x934a44){_0x4b35de=_0x4b35de-0x0;var _0x5af235=_0x05fe[_0x4b35de];return _0x5af235;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xe05f('0x0'));var inlineBase64=require(_0xe05f('0x1'));function EmailSmtp(){}EmailSmtp[_0xe05f('0x2')][_0xe05f('0x3')]=function(_0x2f23f7,_0x53c920){return new BPromise(function(_0x3b3a25,_0x5a8b78){var _0x5bd1b1=nodemailer[_0xe05f('0x4')](_0x2f23f7);_0x5bd1b1[_0xe05f('0x5')](_0xe05f('0x6'),inlineBase64());_0x5bd1b1[_0xe05f('0x7')](_0x53c920,function(_0x1e435c,_0x4109cb){if(_0x1e435c){_0x5a8b78(_0x1e435c[_0xe05f('0x8')]());}else{_0x3b3a25(_0x4109cb);}});});};EmailSmtp['prototype'][_0xe05f('0x9')]=function(_0x1edf14){return new BPromise(function(_0x31f3dd,_0x4a28c0){var _0x377e25=nodemailer[_0xe05f('0x4')](_0x1edf14);_0x377e25[_0xe05f('0x9')](function(_0x410874,_0x13656d){if(_0x410874){_0x4a28c0(_0x410874['toString']());}else{if(_0x13656d){_0x31f3dd(_0x13656d);}else{_0x4a28c0(_0xe05f('0xa'));}}});});};module['exports']=EmailSmtp;