This adds a field and option to the example module which demonstrates the issue here: #2904611: Seeing errors when sending a mail with files attached as file contents

Comments

imclean created an issue. See original summary.

imclean’s picture

Status: Active » Needs review
StatusFileSize
new1.7 KB
imclean’s picture

The patch in #2 is an arbitrary test case which demonstrates the problem.

A real-world use case could involve generating a PDF and attaching the contents to the email without having to save the file anywhere. For example, the FPDM library can return the PDF contents

tr’s picture

Yes, this patch can be used to verify the problems raised by #2904611: Seeing errors when sending a mail with files attached as file contents (and by a dozen similar issues over the years).

We should probably also add a form input so that a file URL can be entered and attached.

That will give use three ways to attach files:

  1. Upload from client (already in mimemail_example)
  2. Type in or paste in contents (this patch)
  3. Enter URL of file (can be public:// or http:// or an absolute file path. Needs to use permissions properly!)

Are there other ways of attaching files that aren't covered by these three use cases?

These three cases should probably be altogether in a details form element, to simplify the UI.

tr’s picture