Currently only available on Google domains.
Email signature templates can be made even more flexible through the use of conditional logic.
The following conditional logic options are available:
#if
This is used to check is a statement if true or false. If the statement is true the proceeding value will be printed, if it's false nothing will be printed unless it's followed by an #else statement (see below).
#elseif
Multiple statements can be chained together using #elseif, this is used in place of #if for any additional values that need to be checked after the initial #if statement.
#else
This is used to determine what value will be printed if the #if or #elseif statement returns false.
#end
This must be used to delineate the end of a single statement or chain of statements.
==
Value is equal to.
!=
Value is not equal to.
>
Value is greater than.
<
Value is less than.
>=
Value is greater than or equal to.
<=
Value is less than or equal to.
Examples
IF a users first name is equal to John then print My name is John!
# if ($personalName == "John" ) My name is John! #end |
IF a user's surname is not equal to Smith then print My surname is not Smith!
# if ($personalSurname != "Smith" ) My surname is not Smith!#end |
IF a user's business phone number is NOT blank then print Phone Number: 000-000-000
# if ($phoneBusiness != "" )Phone Number: $phoneBusiness#end |
IF a user's business number is not blank, then print "Call Me at: business number", otherwise if it is blank then print "Call Me at: main number", otherwise if the main number is also blank then print "Call Me at: business mobile", otherwise if the business mobile is also blank then print "Call Us at: company number".
# if ($phoneBusiness != "" )Call Me at: $phoneBusiness #elseif ($phoneMain != "" )Call Me at: $phoneMain #elseif($phoneBusinessMobile != "" )Call Me at: $phoneBusinessMobile # else Call Us at: $rootBusinessPhone#end |
IF a user is a member of group.one@example.com then print "I'm part of Group.One"
# if (${profile.groups.contains( "Group.one@example.com" )}) I'm part of Group.One#end |
Group Based Signatures
Other than Smart Teams, it's possible to nest statements to generate a different signature based on group memebership.
IF a user is a member of smart_group_1@example.com then apply the HTML_FOR_SIGNATURE_1, if not but they are a member of smart_group_2@example.com then apply the HTML_FOR_SIGNATURE_2, and if they are not a member of either group then apply the HTML_IF_NO_GROUP_MEMBERSHIP.
<p># if (${profile.groups.contains( "smart_group_1@example.com" )})</p> <p>HTML_FOR_SIGNATURE_1</p> <p># else </p> <p># if (${profile.groups.contains( "smart_group_2@example.com" )})</p> <p>HTML_FOR_SIGNATURE_2</p> <p># else </p> <p>HTML_IF_NO_GROUP_MEMBERSHIP</p> <p>#end</p> <p>#end</p> <p>#end</p> |
It's recommended to first create each signature you want to generate, then copy/paste the source code of that signature in place of HTML_FOR_SIGNATURE_1, HTML_FOR_SIGNATURE_2 etc within the source code editor. The above code and the HTML for any signature you create should be added using the source code editor and not the WYSWIG editor.
When using #if statements in signatures, sometimes the WYSIWIG editor doesn’t add a line break to the HTML code. This means when there is no value matching the #if statement it leaves a blank line in the generated signature.
To fix this:
Add a line break <br /> in the HTML right before $orgjobtitle:
Before:
#if($orgJobTitle != "")</span><span style="font-family: tahoma, arial, helvetica, sans-serif;">$orgJobTitle#end
After:
#if($orgJobTitle != "")</span><span style="font-family: tahoma, arial, helvetica, sans-serif;"><br />$orgJobTitle#end
Comments
0 comments
Please sign in to leave a comment.