This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 4
Possible bug in v. 4.4: Email attachment lacks .PDF extension
Started 10 years ago by williamansley | 3 posts |
-
I have just upgraded to Machform v. 4.4 and in my testing, using the latest version of Chrome on Windows 7, when I check "Attach Completed Form Data as PDF File" the attached file is given a name from the subject of the sent email, which is OK, but it does not have the .pdf file extension, so the file doesn't open in Adobe Acrobat Reader (or whatever you default application for viewing PDF files is). Is anyone else seeing this?
Posted 10 years ago # -
You're right. This seems to be a bug.
To fix this, you can edit the "includes/helper-functions.php" file, search around line 878 for this code:if(file_exists($pdf_filename)){ $s_message->attach(Swift_Attachment::fromPath($pdf_filename)->setFilename($subject)); }
change it to become:
if(file_exists($pdf_filename)){ $s_message->attach(Swift_Attachment::fromPath($pdf_filename)->setFilename($subject.".pdf")); }
We'll update the package soon with this fix. Thanks!
MachForm Founder
Posted 10 years ago # -
For anyone else that want to fix this issue immediately, I made the change to the code that Yuniar describes in his message above, and it has fixed the problem; the PDF email attachment now has a .pdf file extension.
Posted 10 years ago #
Reply
You must log in to post.