Support filecontent attachments

Created on 16 September 2019, over 5 years ago
Updated 12 May 2023, over 1 year ago

Per this comment ( https://www.drupal.org/project/htmlmail/issues/1428802#comment-8292789 β†’ ):

The #7 patch worked for me when I'm returning the filepath in $attachments['file'] not when returning the file data in it..

I found the same to be true. The code in htmlmail.mail.inc is hard coded to assume the passed-in value is a uri. However, $mime->addAttachment supports either a file or file contents:

  /**
   * Adds a file to the list of attachments.
   *
   * @param $file
   *   The filename to attach, or the file contents itself.

See: https://git.drupalcode.org/project/mailmime/blob/7.x-2.x/mailmime.inc#L271

The attach patch removes this restriction, checking if the params possibly include filecontent. This allows HTMLMail + MailMIME to work with modules like Commerce Billy Mail, which attaches a PDF invoice as generated file content.

Please review, thanks.

✨ Feature request
Status

Closed: won't fix

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ron_s

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024