This Mastermind tip is contributed by Rob Levine (@RobL) from the Formidable Slack Community. Thank you Rob!
I am using e2PDF to create a PDF of a submitted Formidable Form. The difference for me is that I both want to save it to the server and do it without the user knowing (or caring) that it’s happening. While the e2PDF documentation has excellent shortcode descriptions, it falls very short of telling you where to use the shortcodes in the Formidable Forms or Views. Formidable suggests using it as part of the Submit message. In my case that didn’t work because I would need to redirect to a landing page to be able to use the shortcode or use an unnecessarily complex AJAX solution.
The solution is to use Formidable’s frm_after_create_entry and frm_after_update_entry hooks and, using WordPress’ do_shortcode function, execute the e2pdf-save shortcode. That sounds a little easier than it is because I needed to fill in several e2pdf parameters that differed based on which form was being submitted. Here is the example code I used with my specifics stripped out.
Leave a Reply