New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nodemailer-mailgun-transport

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemailer-mailgun-transport - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

CONTRIBUTORS.md

8

package.json

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

"description": "A transport module to use with nodemailer to leverage Mailgun's REST API",
"version": "1.0.1",
"version": "1.0.2",
"repository": {
"type": "git",
"url": "git@github.com:orliesaurus/nodemailer-mailgun-transport.git"
},
"keywords": [

@@ -30,4 +34,4 @@ "email",

"dependencies": {
"mailgun-js": "^0.6.7"
"mailgun-js": "0.7.10"
}
}

@@ -39,2 +39,4 @@ nodemailer-mailgun-transport

to: 'recipient@domain.com', // An array if you have multiple recipients.
cc:'second@domain.com',
bcc:'secretagent@company.gov',
subject: 'Hey you, awesome!',

@@ -41,0 +43,0 @@ 'h:Reply-To': 'reply2this@company.com',

@@ -23,7 +23,8 @@ 'use strict';

MailgunTransport.prototype.send = function send(mail, callback) {
var mailData = mail.data;
// convert nodemailer attachments to mailgun-js attachements
if(mail.data.attachments){
if(mailData.attachments){
var a, b, aa = [];
for(var i in mail.data.attachments){
a = mail.data.attachments[i];
for(var i in mailData.attachments){
a = mailData.attachments[i];
b = new this.mailgun.Attachment({

@@ -38,14 +39,25 @@ data : a.path || undefined,

}
mail.data.attachment = aa;
mailData.attachment = aa;
// delete obscelete attachements key
delete mail.data.attachments;
}
var options = {
type : mailData.type,
to : mailData.to,
from : mailData.from,
subject : mailData.subject,
text : mailData.text,
html : mailData.html,
attachment : mailData.attachment
}
if( mailData.bcc ){
options.bcc = mailData.bcc
}
// for some reasons, this trigger and error if present...
// @todo: understand why (or where) its happening...
delete mail.data.headers;
this.mailgun.messages().send(mail.data, callback);
this.mailgun.messages().send(options, function (err, data) {
callback(err || null, data);
});
};
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