How to access generated file from PHP action in email action as attachment?

Attach a dynamically generated PDF to an email in ChronoForms.

Overview

The issue occurs because the file path placeholder used in the email action is not recognized or resolved correctly.
Enable form debug mode to identify the correct shortcode for the generated file's path, then use that specific shortcode in the Custom Attachments field of the email action.

Answered
ChronoForms v8
we webmaster-bogen 02 Feb, 2026

Hi Max,

okay, thank you very much for your answer regarding PDF templates.

I have implemented it with a PHP action using FPDF, FPDI and used my PDF template to insert the values into the template and generate a new PDF file.

So far so good :-)

After that action I would like to forward the PDF via E-Mail action, but I do not know how to specify the attachment?

In my PHP action I have created this

// -----------------------------
// Für Email Action bereitstellen ({path:front} nötig für ChronoForms)
// -----------------------------
$this->data['generated_pdf'] = '{path:front}/images/pdf_export/' . $pdfFileName;
$this->data['generated_pdf_name'] = $pdfFileName;

and in the email action I used this name like that:

How to access generated file from PHP action in email action as attachment? image 1

But I get the error: Could not access file: {generated_pdf}

Do you have any idea how to achieve that?

Thanks a lot 

Markus

Max_admin Max_admin 03 Feb, 2026
Answer

Hi Markus

The path to the generated PDF file will be shown in the form debug when you enable it, you need to use the shortcode for that path in the Custom Attachments box as you have done:

How to access generated file from PHP action in email action as attachment? image 2

in my example, the shortcode will be: {var:tcpdf10.path}

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin Max_admin 14 Feb, 2026

No problem

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply