Deeply troubled by PDFs not sending in emails

By: Anthony Wheeler | Asked: 09/27/2023
ForumsCategory: Code HelpDeeply troubled by PDFs not sending in emails
Anthony WheelerAnthony Wheeler asked 1 year ago
Greetings Everyone,  I've been getting to know FF and generally am all praise.  That said, I'm having a terrible time sending PDF's with my emails. Can someone guide me?  For example: I've created the absolute simplest of forms and click the "Attach PDF of Entry to Email" and when I fill out the form, I receive an email, with the relevant information in it, but no PDF attached.  When I create a more complex form and create a Detailed Page to make a fancier PDF that is particular to a persons entry, I then add the shortcode to the email confirmation: [frm-pdf id=x], I change the X to 39645 (taken from that view: [display-frm-data id=39645]), but this does not create a downloadable link in my confirmation email, only the words: Download PDF. Again, with no link.  Again, I am able to receive emails, but they do not include the PDF's or the links to the PDF's.  I have the Views and PDFs add on's activated and everything is up to date. Can anyone see what might be going wrong for me? Thanks for any advice you can give. - Anthony 
6 Answers
Walter JonesWalter Jones answered 1 year ago
What are you using to send mail with Wordpress?  Do you have an smtp client setup?  

[frm-pdf source="display-frm-data" id="10" public="1"]
try that in your view replace 10 with your view id 
Anthony WheelerAnthony Wheeler answered 1 year ago
Thank you Walter.    I'll go look into these suggestions you've given and I thank you for a place to move from.  My site is able to send emails for contact forms, process payments and send email confirmations and all of that, it seems that it's just the PDF's that don't get generated or go through. I'll look into what you've suggested. Thanks again. 
Anthony WheelerAnthony Wheeler answered 1 year ago

Hello again Walter or others who might have ideas about emailing my custom PDF's.  I have made some progress but am still not getting my email confirmations to contain an active link to a PDF as planned.  I found that the reason I can't use the default "attach PDF" feature is that I'm using MailPoet for sending emails from my site and it doesn't allow attachments. Which is fine as I want to send a custom PDF made via Views in FF.  I'm able to add this short code to a confirmation message and it shows up as a link taking me to the correct PDF form.  [frm-pdf view=39683 entry="[id]" public=1] However, when I add this to an email it only says: Download PDF, but it is not an active link.  The confirmation emails will offer an active link, say for the email address in the form, just not the PDF download.  Here is a practice page I have been using for this issue: https://www.se-reflections.com/challenge-on-pdf-street/ Thanks for any advice you can give!  Cheers,  Anthony 

Rob LeVineRob LeVine answered 1 year ago
@Anthony Wheeler - If I understand your requirement correctly, in your email action, you turn on the option "Attach PDF of entry to email" and then you use the frm_pdfs_email_attachment_args hook to set the view id of the pdf to the view you want to be attached.  It worked for me.
Anthony WheelerAnthony Wheeler replied 1 year ago

Thanks for your feedback Rob. I'm thinking that solution isn't going to work for me though as my mail plugin (MailPoet) won't send attachments so I'm left needing to set a link to point to the PDF to download. At that, you're another step ahead of me on Hooks as I've not implemented those in WordPress before and am unsure how to go about that just yet.

Anthony WheelerAnthony Wheeler answered 1 year ago

Update:  By using this shortcode that Walter pointed me to (and FF documentation says to use!):  [frm-pdf source="display-frm-data" id="10" public="1"] or [frm-pdf view=10 public=1] (with 10 replaced with my view id).  I'm able to get a download link included in the Confirmation Message.  I'm also able to get an email to send a link that will lead to the PDF as planned - IF, and currently only if, I do not send the email in plain text - which of course I want to do or the email reads as code rather than simple text for clients.  If I click the toggle "Send Emails as Plain Text" the text itself, like "download PDF" shows up in the confirmation emails, but it is not a link so doesn't go anywhere.  Here is a test page I'm working with for reference: https://www.se-reflections.com/challenge-on-pdf-street/ I am grateful for continued feedback and suggestions if anyone can see what I'm doing wrong or what is missing.  Anthony 

Anthony WheelerAnthony Wheeler answered 1 year ago
I'm a bit clearer on the limits of what is happening in my attempt to add a link to a PDF created by Views Detail page in a confirmation email.  I'm able to create such a link and see it in the confirmation upon submission. That link works and takes me to a browser page showing the PDF.  When I add this shortcode [frm-pdf source="display-frm-data" id=10 entry_id=[id] public=1] to an email to produce the same link to the PDF with the Send Email function, the text in the email will read "Download PDF" but it does not "link" to the PDF. However a link is generated in an email if the email is not sent as "plain text." In that case the link is available (blue) and leads to the PDF as expected. I do not know how to solve this conflict or what is causing it. Other links in practice confirmation emails work just fine, but the links to the PDF's do not generate when the email is sent as plain text.  Go figure.     

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right