Dynamically adjust email and thank you message content without PHP knowledge
A common need of RSForm!Pro users is to remove uncompleted fields from the User/Admin/Additional emails, Thank You message's text, or even the Manage Directories emails. Until now, achieving this was possible (see this article), but a little too complicated for non-PHP savvy users.
We have simplified this process by adding a custom syntax to be used in your message body.
This syntax is based on a simple if condition and looks like this:
{if {name_of_field:value}} Display this text if the form_component field has a set value.{/if}
You will need to replace name_of_field with your actual field's name.
Note: The syntax is similar to HTML as it has an opening and an ending tag.
RSForm!Pro also allows you to compare the value of the field when using if statements.
Example:
{if {name_of_field:value}}The submitted message is {name_of_field:value}.{/if}
The string found within the {if} syntax will not show if the field has no value.
The {if} clause also accept the following operators:
<= , >=, <>, <, >, !=, =,==,===, <-, ->
Assuming that you have a checkbox and you need to compare its value with a specific string, you will use:
{if {Checkbox:value}<-Item1}This text will be displayed if the Item1 value is selected, regardless of any other selections{/if}
If you want to display a text if the checkbox has only at least one of your desired values, you will use the following syntax:
{if {Checkbox:value}->Item1,Item2}This text will be displayed if one of the following values is selected: Item1 or Item2, or if both are selected. It will not display if another additional value is selected{/if}
If you want to see if the user entered a specific value into a field you can use the following syntax (works for a single checkbox value as well):
{if {field_name:value}=Your desired value} this text gets displayed only if the placeholder has the "Your desired value" value {/if}
You can also compare two placeholder values using <, >, <= or >=
{if {field_name:value}<{other_field:value}} this text will be displayed if {field_name:value} has a lower value {/if}
Notice the blank space between "if" and the field placeholder.
You can also use a nested {if} syntax, for example:
{if {field1_name:value} = value1}
{if {field2_name:value} = some value}
this text will be displayed if {field1_name:value} has 'value1' selected and 'some value' in the {field2_name:value}
{/if}
{/if}
98 persons found this article helpful.
You Should Also Read
How do I show the uploaded image in the Thank You message? HOT |
Setting up the Thank You message to open a new window |
Loading content plugins in the Thank You message |