mailgun.js
Advanced tools
Comparing version 3.5.5 to 3.5.6
@@ -5,2 +5,9 @@ # Changelog | ||
### [3.5.6](https://github.com/mailgun/mailgun-js/compare/v3.5.5...v3.5.6) (2021-08-12) | ||
### Bug Fixes | ||
* Blob and buffer attachments not working ([ad69bda](https://github.com/mailgun/mailgun-js/commits/ad69bdaed5627d62571f58b1a79ac870c5086b14)) | ||
### [3.5.5](https://github.com/mailgun/mailgun-js/compare/v3.5.4...v3.5.5) (2021-08-09) | ||
@@ -7,0 +14,0 @@ |
@@ -5,2 +5,2 @@ /*! MIT License © Sindre Sorhus */ | ||
/*! mailgun.js v3.5.4 */ | ||
/*! mailgun.js v3.5.5 */ |
@@ -155,2 +155,13 @@ import base64 from 'base-64'; | ||
createFormData(data: any): IFormData { | ||
const appendFileToFD = (key: string, obj : any, formDataInstance: IFormData): void => { | ||
const isStreamData = isStream(obj); | ||
const objData = isStreamData ? obj : obj.data; | ||
const options = getAttachmentOptions(obj); | ||
if (isStreamData) { | ||
formDataInstance.append(key, objData, options); | ||
return; | ||
} | ||
formDataInstance.append(key, objData, options.filename); | ||
}; | ||
const formData: IFormData = Object.keys(data) | ||
@@ -164,10 +175,6 @@ .filter(function (key) { return data[key]; }) | ||
obj.forEach(function (item) { | ||
const itemData = isStream(item) ? item : item.data; | ||
const options = getAttachmentOptions(item); | ||
(formDataAcc as any).append(key, itemData, options); | ||
appendFileToFD(key, item, formDataAcc); | ||
}); | ||
} else { | ||
const objData = isStream(obj) ? obj : obj.data; | ||
const options = getAttachmentOptions(obj); | ||
(formDataAcc as any).append(key, objData, options); | ||
appendFileToFD(key, obj, formDataAcc); | ||
} | ||
@@ -174,0 +181,0 @@ |
{ | ||
"name": "mailgun.js", | ||
"version": "3.5.5", | ||
"version": "3.5.6", | ||
"main": "dist/mailgun.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is too big to display
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
1916771
4142
159