How to use conditions in mail body?

I have a form page which will send an email when the form values are submitted to the database for storage.

That Send Mail body code has these 2 lines.

If a “{{$_POST.gender}}” value = “Frau” then only the Div id “conditional2” will be generated in the html and displayed in the email on arrival.

If a “{{$_POST.gender}}” value = “Herr” is detected then the “Frau greeting” is not generated in the body of the email and the “Herr greeting” is the only greeting displayed in the email.

But I don’t know how to write the Conditional code here. I’ve looked at various examples but they don’t seem to match my situation.

Because the Email body is only written into a DMXConnect/API/sendemail.php file I thought I’d have it available in the API send email script.

I want to try this but I don’t know how to express this in Wapplerese. So I am sitting here with just the starting id values “conditional1 & conditional2”

In javascript in multiple conditons I’d sometimes have to also write HIDE conditionals as well to make forms behave.

So by editing the actual Sendemail.php API file where the selected value of “{{$_POST.gender}}” is inserted into the database I hope to find it a little further down in the scope of the send email function.

I would appreciate some expertise here.

Community Page
Last updated: