Forums

Is it possible to have conditional in email template?

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?
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😉
GreyHead 09 Apr, 2014
Hi moleculezz,

Yes it is.

Bob
moleculezz 09 Apr, 2014
Nice try, but that's not what I'm looking for😉
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 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.
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.