Hello, I'm trying to send attachments via swiftmailer programatically, however something seems to be wrong. I read the README.TXT and the documentation for sending attachments ( https://www.drupal.org/node/1590190 → ). There are some discrepancies between both:
The first indicates that the file should be passed to $message['files'] while the latter to $message['params]['files].
I decided to dig inside the module code and found that the mail() function expects the files to be in $message['params']['files'] and this is where it gets tricky. In my custom module I defined the $message['params'] accordingly with the documentation and nothing happened so I came back to the module code and added some variable dumps to see what happened. What I found was that no matter what I did in my hook_mail() the $message['params] variable never appear in the swift mailer mail() function. If I defined something like $message['params1] or $message['random_string'] the variables are passed to the mail() function however $message['params] never is. Am I missing something? Does anyone have a working example of adding attachments in your hook_mail()?
Just as a note I tested the hook_swiftmailer_attach() function and using this the file is attached
Closed: works as designed
2.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.