Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodemailer-unione-transport

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemailer-unione-transport - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.npmignore

2

package.json

@@ -5,3 +5,3 @@ {

"description": "A transport module to use with nodemailer to leverage UniOne's REST API (http://www.unisender.com/?a=opencart)",
"version": "0.0.1",
"version": "0.0.2",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -0,0 +0,0 @@ nodemailer-unione-transport

@@ -15,3 +15,3 @@ 'use strict';

*/
function Unione(options) {
function UnioneTransport(options) {
options = options || {};

@@ -34,3 +34,3 @@

UnioneTransport.prototype.send = function (mail, callback) {
this.sendMessage(mail, callback);
this.sendMail(mail.data, callback);
};

@@ -42,3 +42,3 @@

*/
UnioneTransport.prototype.sendMessage = function (mail, callback) {
UnioneTransport.prototype.sendMail = function (mail, callback) {
this.callUnioneAPI('/ru/transactional/api/v1/email/send.json', mail, (function (err, res) {

@@ -48,7 +48,15 @@ if (err) {

}
try {
var response = JSON.parse(res.body);
}
catch(err) {
return typeof callback === 'function' && callback(new Error('UniOne Error: non-JSON response'));
}
/**
* @todo Обработка статуса отправки письма от UniOne
* Обработка статуса отправки письма от UniOne
*/
console.log(res);
callback(err, res);
if (response.status == 'error') {
return typeof callback === 'function' && callback(new Error('UniOne Error: '+response.message));
}
return typeof callback === 'function' && callback(null, response);
}).bind(this));

@@ -64,8 +72,7 @@ };

}
request({
method: 'post',
url: url,
form: json
form: JSON.stringify(json)
}, callback);
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc