Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Missing attachment parameter documentation #69

Closed
opyh opened this issue Jul 4, 2016 · 6 comments
Closed

Missing attachment parameter documentation #69

opyh opened this issue Jul 4, 2016 · 6 comments

Comments

@opyh
Copy link

opyh commented Jul 4, 2016

Hi,

the documentation link for how to specify attachments seems to point to an API that is different from the actually working attachment API.

Using the documented API results in missing attachments (there should be an error message for attachments that are not correctly specified, but there isn't. Always sanitize your input arguments! :) )

This is working for me:

attachments: [{
  fileName: "my-file.jpg",
  filePath: 'https://s3…/my-file.jpg',
  contentType: 'jpg'
}]

Not working for me:

attachments: [{
  filename: 'license.txt',
  path: 'https://raw.github.com/andris9/Nodemailer/master/LICENSE'
}],

Note the different case fileName vs. filename and filePath vs. path here.

I couldn't find out when the API exactly changed, but did this write-up so hopefully it helps somebody who needs to get attachments working with meteor-emails.

Thanks for your otherwise awesome package!

@johanbrook
Copy link
Contributor

johanbrook commented Jul 4, 2016

Hi there!

Thanks for reporting in. What a mess, the official Meteor docs points to this: https://github.com/nodemailer/mailcomposer/blob/7c0422b2de2dc61a60ba27cfa3353472f662aeb5/README.md#add-attachments which is inconsistent with the main, master README in the MailComposer repo .. The options described in the link matches the ones in your successful test above.

Since I pass this option on to Meteor's Email module, I feel it's not up to this package to validate the keys inside of an attachment array. But I'll update the README with the correct info.

@johanbrook
Copy link
Contributor

Added docs in 69d6b0e.

@opyh
Copy link
Author

opyh commented Jul 5, 2016

The sanitizing reminder was a general thing and not directed at you ;) Thanks for your effort!

@johanbrook
Copy link
Contributor

No worries! Do the changes in the commit above work well now, you think?

@opyh
Copy link
Author

opyh commented Jul 5, 2016

Yes! 👍

@johanbrook
Copy link
Contributor

Sweet! Thanks again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants