Is it possible to have conditional in email template?

How to use conditional logic in ChronoForms email templates.

Overview

The issue arises when needing to hide form elements in emails that are conditionally shown on the webpage.
You can embed PHP if/else statements directly in the email template code, ensuring the Rich Text Editor is disabled. Additionally, consider using include statements, Custom Code actions, or Event Switcher actions for more complex conditional email content.

Answered
mo moleculezz 09 Apr, 2014
Hi,

I am using a show/hide Javascript to show or hide a group of elements based on a checkbox.
It would be nice if I could also hide these elements from the email template.
Is it possible to use if/else conditions in email templates?
ca calculus00 09 Apr, 2014
Hello moleculezz,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
Some email data is missing
P.S: I'm just an automated service😉
mo moleculezz 09 Apr, 2014
Nice try, but that's not what I'm looking for😉
mo moleculezz 09 Apr, 2014

Hi moleculezz,

Yes it is.

Bob



Hi Bob,

And how exactly do I do that?
Can I use php tags with conditionals?
Max_admin Max_admin 09 Apr, 2014
Answer
Yes, example:

<?php if($form->data["checkbox"] == "X"): ?>
Your conditional html code in email
<?php endif; ?>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Gr GreyHead 10 Apr, 2014
Hi Moleculezz,

As well as Max's suggestion* you can:

+ Use include statements to add completely different templates or parts of templates

+ Use Custom Code actions to build different parts of templates

+ Use the Event Switcher actions to select different Emails to send.

It does all depend on exactly what you need to do.

Bob

* If you use PHP in the Email template you **must** keep the Rich Text Editor turned off.
This topic is locked and no more replies can be posted.