Closed (fixed)
Project:
Webform
Version:
6.x-3.9
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Mar 2011 at 13:54 UTC
Updated:
8 Jun 2011 at 21:41 UTC
Jump to comment: Most recent file
I want to attach a PDF with webform2pdf module to the e-mails, containing the submitted webform values.
This works flawlessly, if the mimemail module doesn't exists. Otherwise, it accepts the attachment in an array, which is given by webform, but this variable isn't accessible externally.
This hook tries to solve this problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | webform_attachments_alter.patch | 1.2 KB | quicksketch |
| #6 | issue-1087796-2.patch | 925 bytes | mr.york |
| #1 | issue-1087796-1.patch | 1.18 KB | mr.york |
Comments
Comment #1
mr.york commentedPatch.
Comment #2
mr.york commentedComment #3
quicksketchIs this hook really necessary? Could we just pass attachments along in $mail_params variable, which is then accessible in hook_mail_alter()? Adding another hooks when another hooks is called in the exact same place seems wasteful.
Comment #4
mr.york commentedGreat idea, but i doubt it will work, because drupal_mail() doesn't accepts parameters as reference (http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/6). Parameter will not be usable in hook_mail_alter() (http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo...).
Comment #5
quicksketchdrupal_mail() doesn't need to take things by reference, it returns the $message array to Webform, which Webform then could use to send the e-mail. The $message array is passed by reference in hook_mail_alter().
Comment #6
mr.york commentedSecond attempt.
Comment #7
quicksketchNot quite what I meant but close enough I could adapt the patch easily. This patch should fix the problem and I've committed it to Git.
Comment #8
quicksketchComment #9
mr.york commentedThank you!
Comment #10
roderikThe committed patch doesn't actually work - $message['attachments'] does not contain the attachments.
See #1162112-17: Mime Mail error after upgrade Webform for followup. That issue gets much more traffic than this one, so I won't change statuses.