PDF link insterted in an email

WordPress Under Review
13 November, 2019 02:50:20
esaeducation
Topics: 4
Messages: 9
Dear support team,

We are using a plugin on our website that is sending an email to the users after their project is approved. When I include the code [e2pdf-download id="4" dataset="11578" ] in an article the download link is generated.

How can I dynamically generate a link to be included in the email so the users when they click on it the pdf to be generated ?

An example where the code is working: https://mooncampchallenge.org/certificate/
13 November, 2019 06:38:36
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

Do you need to use dynamic dataset inside email? If so unfortunately Dynamic Datasets doesn't supported in emails for WordPress extension, as this value connected to Post ID where shortcode placed.

The only way is to use hooks for plugin that you are using via PHP and update mail body:

$link = do_shortcode('[e2pdf-download id="4" dataset="11578"]');

You can let us know the plugin name that you are using so we can check if there any other possibilities.

Another solution can be to use Formidable Forms, Gravity Forms, or Caldera Forms. "dataset" will be the Entry ID.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
13 November, 2019 06:53:16
esaeducation
Topics: 4
Messages: 9
Dear support team,

I really appreciate your fast reply. I will try with the pdf function mentioned.

The plugin used is: adforest classified wordpress theme.

https://themeforest.net/item/adforest-classified-wordpress-theme/19481695
15 November, 2019 04:23:39
esaeducation
Topics: 4
Messages: 9
Unfortunately the solution provided it doesn't work. The plugin is not executed before sending the mail so there is no generated link.

How can I generate a link that is dynamically building the pdf and send the arguments via the link ?

Kind regards,

Adrian
15 November, 2019 07:41:49
E2Pdf
Support
Topics: 7
Messages: 3163
Hi, we checked AdForest theme, unfortunately it doesn't allow simple hooks to update mail body but you can overwrite standard action to send emails on approval.

We have prepared code example, it must be inserted to functions.php of your theme.

https://codeshare.io/5eyr99

After adding code, you can insert to "Ad Activation Email": %e2pdf_download%

It will be converted to PDF download link for current Ad Posted ID with updated function.

P.S. Keep in mind please that if you are not using child theme, changes that you made to your functions.php of main theme can be truncated after theme update.

We remain at your service.
We would really appreciate your feedback at WordPress.org!