Submit email message

How to conditionally include form data in email messages.

Overview

The issue is that standard email actions cannot dynamically show or hide content based on form field values.
Use a PHP action to build the conditional content and then reference its variable in the email body, or use an HTML view with PHP enabled, capture its output with an Output Buffer action, and reference that buffer in the email.

Answered
ChronoForms v8
kr kraadde 19 Feb, 2026

Max,

is it somehow possible to have the email message containing conditional information?

I.e if the form entry x is "ABC" then the message should contain the line: x = abc

if x is empty, then the line shall not appear in the message

Any possibility to add some PHP or HTML code inside the message settings?

Max_admin Max_admin 20 Feb, 2026
Answer

Hi kraadde

You can use a PHP action, build your content then call {var:php_name} in the Email action body

OR

You can use an HTML view and enable the PHP behavior, build your content, place the HTML view inside an Output Buffer action and lastly call the {var:ouput_buffer_name} in the Email action body

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