I have setup a form with webform 6.x-3.4 and webform2pdf 6.x-2.x-dev. I have installed tcpdf v5.9 into the libraries directory. Under the Generate PDF menu, I have Attach PDF... checked and have a header and content. My problem is I am receiving an email with each form submission but there isn't any attachment. Any suggestions would be appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | webform2pdf-968316-2.patch | 1.44 KB | javi-er |
| #8 | webform2pdf-968316.patch | 2.43 KB | javi-er |
Comments
Comment #1
harpsw commentedI forgot to mention that the Download PDF link does work on the Results tab. I just can't get the pdf attached to the submission emails.
Comment #2
shafter commentedPlz try to clear cache and theme registry. Please try RC1, if the problem persists there too.
Are you using mimemail, smtp modules?
Comment #3
argent commentedHaving the same issue with same versions.
Cleared cache, tried the rc1, but rc1 does not support webform 3.4, there are no preferences of webform2pdf while changing a webform.
I am using mimemail.
Comment #4
Mr J commentedDone the same, no results.
Interesting in my case is that one webform is generating the pdf perfect.
The other webform is not attaching the file at all...
Cant find anything in the setup thats different.
Comment #5
marascos commentedI also am not able to receive email attachments though I can download them from the results page from any form I create. I am using SMTP Authentication Support.
Comment #6
tiheum commentedI experiemnt the same issue with RC1 and webform 6.x-3.4. After a few tests, it seems that the function webform2pdf_preprocess_webform_mail_message does not run. So, the global variable $webform2pdf_send2pdf is not set when webform2pdf_mail_alter is called.
Comment #7
pierog1971 commentedSame issue, i.e., PDF is not attached to the email to one of my forms, while the attachment works fine with another. I use Webform 6.x-3.4 , W2PDF 6.x-2.0-rc1, and TCPDF_5_9_034.The PDF can be downloaded but does not attach to emails.
I set out out to experiment with different settings as I do not know PHP and think I might have found a culprit. Under e-mails , one cannot save a custom template. The PDF is only attached to an email if I keep Default Template as the selection and more importantly the default text inside of the template, i.e.,
Submitted on %date
Submitted by user: %username
Submitted values are:
%email_values
The results of this submission may be viewed at:
%submission_url
Using the defaults above in the E-mail template allows PDF attachment. ANY alteration to the E-mail Template results in the PDF not being attached. The setting seems to always save it as a Default Template independent of the selection or alteration that is made. The Custom Template setting appears not to work.
The 2nd odd PDF-generated issue is that the fields which use a select list, when left unselected, display the first selection from the list with a comma behind it,e.g., If the selection list is Yes No NA, the PDF displays "Yes," . An actual selection of Yes, displays as "Yes". As part of an email the fields show up OK, i.e, unselected ones are blank. It should be a quicker fix, I assumed.
I actually was able to find a temporary solution.
When I looked at the Manual Entry, the key-value pairs were the following:
0|Yes
1|No
2|NA
In fact all my select fields lists begun with a 0 and had the issue described above. Replacing the 0 with another value fixed the issue in all cases, for instance,
Yes|Yes
No|No
NA|NA
As I have not looked into the Manual Entry before, I do not know whether the numerical arrangement is a default setting.
The last problem left was that when using the "Allow "Other..." option", the PDF did not print a value when it was entered.
I tried to get around this by using the key-value pair of select_or_other|Other... getting it to show up on the email and Results/View but still not in the PDF. Turning the "Other.."option off fixes the issue.
Thank you very much for your help and great module.
Comment #8
javi-er commentedI'm having the same problem, the issue is that Webform just calls to the theme function when using the default template, see webform.module:
I took a look to webform2pdf.module webform2pdf_preprocess_webform_mail_message function and looks like that the only reason this function exists it's to get access to $node and $submition, however Webform is already setting these two variables when sending the email, therefore these are available in $message param of hook_mail_alter. So this code could just be included in this hook.
Attached is a patch that renames webform2pdf_preprocess_webform_mail_message to a non-hook function name and calls it from hook_mail_alter passing the $node and $submition variables, this has solved the issue for me and now the PDF's are being attached correctly.
Let me know what do you think.
Comment #9
bosss commentedHi All,
webform2pdf
pdf attachment to mail is not working
any help pls
Comment #10
javi-er commentedSee comments above, it's very likely that the problem is caused because you are using a custom email template, try with the above patch.
Comment #11
bosss commentedHi Javi,
Thanks for your information.
I tried with that patch( means i dint change anything).
i modified webform2pdf.module with your patch.
but no use, any changes required?
Comment #12
fiachra commentedHi,
I am experiencing the same problem with Webform2PDF 6.x-2.0-rc1 and Webform 6.x-3.6. I attempted to apply the batch but it failed.
Hunk #1 FAILED at 122.
Hunk #2 FAILED at 138.
Attachment sends ok with Default template but not with with Custom template
Comment #13
javi-er commentedHi there,
Last patch was done from Eclipse instead of CVS, maybe that's why it fails, attached is a new patch for 6.x-2.0-rc1 that shouldn't fail.
Cheers,
Javier
Comment #14
fiachra commentedHi Javier,
Thanks for the updated patch. Much appreciated. It applied ok this time but caused a parse error on line 157 of webform2pdf.module which appeared to be caused by a missing semi-colon. I got rid of the error by sticking in a semi-colon but unfortunately there are no emails getting sent once the patch is applied.
All the best,
Fiachra
Comment #15
kinga0879 commentedI am experiencing the same issue that fiachra is reporting. Patch applied with no problem, added the missing semi-colon and still no PDFs. Problem occurs with both the default template and a custom template. PDF is available for download when view previous submissions.
Any thoughts?
Comment #16
riggatoney commentedI love this module, however the issues are very inconsistent. I have created a custom pdf template using CSS and this WAS working for a limited time, now the emails are being fired but are not getting attach the pdf.
However if i goto the webform results page I can get the PDF to be generated, I have tried the said patches and they were disappointing.
Comment #17
fiachra commentedCreate a custom email template (webform-form-[nodeid].tpl.php) as described in THEMING.TXT and place it in the root of your active theme. Set webform email settings to default and webform will use this template to send mails for this node with pdf attached.
Fiachra
Comment #18
nagrgk commentedHi Guys ,
If you still have problem ? Because i will be able to create and send pdf attached in mail.
Please reply if you have any question.so, I can try solve the problem
Thanks
NAGARAJA
Comment #19
alice-kahn commentedHi,
Can anyone tell me how can I change the size of the logo for pdf? I don't see any stylesheet and there is a predefined size for logo and predefined style for the header.
Anyone, please help
Thanks, Alice
Comment #20
mr.york commentedBug fix patch: http://drupalcode.org/project/webform2pdf.git/blobdiff/43f9312d6a7445190...