Blog Sections Open

Generating a PDF from eForm Submission Data Before Sending Email

If a form needs to generate a printable document, the safest pipeline is data -> HTML template -> PDF -> mail attachment.

Generating a PDF from form data is much easier once the problem is treated as a pipeline. First collect and validate the form fields, then inject them into an HTML template, then render that HTML as PDF, and only after that hand the resulting file to the mail layer.

The practical stages

  1. receive the validated form data
  2. render the data into a dedicated HTML chunk
  3. convert the chunk output to PDF with a library such as mPDF
  4. attach the generated file to the outgoing email

Once these stages are separated, each piece becomes much easier to debug and reuse in other workflows such as invoices, booking confirmations, or generated reports.

Newer post

Handling Babel and phpThumbOf Across Language Contexts

How to keep image TVs, Babel-linked resources, and phpThumbOf output working correctly when one Evolution CMS site serves multiple language contexts.

Older post

Sorting Ditto Results with AJAX After autoFilter Selection

How to add AJAX-driven sorting on top of an already filtered Ditto result set without rebuilding the whole page experience.