mailgun-js
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -42,3 +42,3 @@ var https = require('https'); | ||
if (params && params.attachment) { | ||
if (params && (params.attachment || params.inline)) { | ||
this.prepareFormData(params); | ||
@@ -95,8 +95,10 @@ } | ||
var obj = data[key]; | ||
if (key === 'attachment') { | ||
if (key === 'attachment' || key === 'inline') { | ||
if (Array.isArray(obj)) { | ||
obj.forEach(this.handleAttachmentObject, this); | ||
for (var i = 0; i < obj.length; i++) { | ||
this.handleAttachmentObject(key, obj[i]); | ||
} | ||
} | ||
else { | ||
this.handleAttachmentObject(obj); | ||
this.handleAttachmentObject(key, obj); | ||
} | ||
@@ -112,7 +114,5 @@ } | ||
Request.prototype.handleAttachmentObject = function (obj) { | ||
Request.prototype.handleAttachmentObject = function (key, obj) { | ||
if (!this.form) this.form = new FormData(); | ||
var key = 'attachment'; | ||
if (Buffer.isBuffer(obj)) { | ||
@@ -119,0 +119,0 @@ this.form.append(key, obj, {filename: 'file'}); |
@@ -8,3 +8,3 @@ { | ||
"keywords": ["email", "mailgun"], | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"homepage": "https://github.com/1lobby/mailgun-js", | ||
@@ -11,0 +11,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
42820
17
761