Variable available inside E2Pdf Template

19 February, 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!
19 February, 2024 06:34:55
E2Pdf
Support
Topics: 7
Messages: 3163
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!
19 February, 2024 07:04:02
aentipufi
Topics: 3
Messages: 5
Thank you for the swift and precise response! It works.