view-pdf as attachement in confirmation email

By: Thomas Kutscher | Asked: 09/11/2023
ForumsCategory: General questionsview-pdf as attachement in confirmation email
Thomas Kutscher asked 1 year ago
actually i provide a download link to "view"-pdfs in every confirmation email. Works perfectly. But the customer needs this pdf as an attachement - not a download-link. How can i manage this?   thanks, tom
2 Answers
Victor Font answered 1 year ago
If you have a Business or Elite license, use the PDF add-on and follow these directions: https://formidableforms.com/knowledgebase/pdfs/#kb-attach-pdf-of-entry-to-email
Thomas Kutscher replied 1 year ago

thnks for your answer.
i have a "Formidable Pro Elite Package". But when i activate the "Attach PDF of entry to email" option, the attached pdf only shows the summary of all entries. Not the custom view i created.

Thomas Kutscher replied 1 year ago

dear victor, do you understand what i mean?

Thomas Kutscher replied 1 year ago

Hey Rob, thanks! I have two view-ids - for two different languages. How can i implement this in this hook?
View 902 for de, View 970 for en.

Rob LeVineRob LeVine replied 1 year ago

I'm not really sure because when you're in the PHP program, you likely only have access to the server language. You can try something like this, but I'm not sure it'll work https://www.geeksforgeeks.org/how-to-detect-browser-language-in-php/

Thomas Kutscher replied 1 year ago

is there a way to solve it with [get_current_language]? This is already implemented to the form to send language-specific confirmation emails

Thomas Kutscher answered 1 year ago
with this:
add_filter( 'frm_pdfs_email_attachment_args', 'add_view_to_attached_pdf', 10, 2 );
function add_view_to_attached_pdf( $pdf_args, $args ) {
	$pdf_args['view'] = 902 ; // ID of view.
	
	return $pdf_args;
}
I get the last three entries in one pdf as attachement. How can i reduce it to the current entry? thx, tom
Rob LeVineRob LeVine replied 1 year ago

In the example on the FF site, you'll see
$pdf_args['id'] = $args['entry']->id;

Thomas Kutscher replied 1 year ago

so i have to create a detail view page first, right?

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