Posts: 69
Threads: 22
Joined: Feb 2009
Reputation:
0
Is there any way to output a submitted form as a PDF email attachment?
Posts: 2,456
Threads: 39
Joined: Dec 2008
Reputation:
6
Hi Antonitus,
I'm afraid not. In the past, I've had this requested from a few clients - and even hacked together a custom solution for one of them, but there's nothing on the roadmap for adding this just yet.
Sorry about that!
- Ben
Posts: 2
Threads: 1
Joined: Mar 2015
Reputation:
0
I did that by using fpdf library. In the email template i have included PHP code that creates PDF, stores it in a temporary file and then attaches it to the mail.
Example of the HTML Template for the mail:
{php}
global $fields;
require ('path/scripts/fpdf17/fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output('temp/form.pdf');
{/php}
{$attachment file="/temp/form.pdf"}
<p>
Thanks for your submission!
</p>