Variable available inside E2Pdf Template

February 19, 2024 06:23:47
aentipufi
Topics: 3
Messages: 5
Hello,

First of all, I would like to congratulate you for this awsome plugin. I have been using the above code to display the profile_id in the generated PDF file, but now, due to GDPR issues, I need to MD5 the profile user_id. I am using this code, but I don't know how to make use of the user_md5 variable inside the PDF template.
echo do_shortcode('[e2pdf-download id="3" dataset="'. $post_id .'" user_id="' . $profile_id . '" user_md5="' . md5($profile_id) . '"]');

I tried [e2pdf-user key="user_md5" meta="true"] but it gets nothing. Also, I tried to md5 on the $profile_id variabile above, but since is no longer an INT, it does not work.

Please help, I need to retrieve the value of the user_md5 variable above in the PDF template.

Thank you in advance!
February 19, 2024 06:34:55
E2Pdf
Topics: 7
Messages: 3617
Support
Hello,

You can try to use:

echo do_shortcode('[e2pdf-download id="3" dataset="'. $post_id .'" user_id="' . $profile_id . '" arg1="' . md5($profile_id) . '"]');

And inside E2Pdf Template the shortcode:

[e2pdf-arg key="arg1"]

Or as an alternative, just use the shortcode inside E2Pdf Template:

[e2pdf-format-output get_md5="true"][e2pdf-user key="ID"][/e2pdf-format-output]

* with PHP function added to your theme functions.php or as PHP snippet: https://codefile.io/f/X0XGS1D1aE

We would really appreciate your feedback at WordPress.org!
February 19, 2024 07:04:02
aentipufi
Topics: 3
Messages: 5
Thank you for the swift and precise response! It works.
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.