Use the "ifboolean" command when you want to create a condition with multiple fields linked by ANDs and ORs.
The "ifboolean" syntax is:
%%
ifboolean
tablename.fieldname1 operand value1 AND/OR
tablename.fieldname2 operand value2 AND/OR
...
tablename.fieldnamex operand valuex
"content-if-true"
"content-if-false"
%%
If you mix ANDs and ORs, you will need to use parentheses to group expressions.
How it works: for each individual recipient, the command evaluates whether the entire condition statement is true. If the condition is true, the command prints content-if-true. If the condition is false, the command prints content-if-false.
Supported Operands
= equals
< less than
> greater than
<= less than or equal to
>= greater than or equal to
<> is not equal to
contains contains
doesnotcontain does not contain
endswith ends with
beginswith begins with
See below for examples of how these are used.
Example 1
You want to include a paragraph that goes to all Florida residents whose interests are dogs or cats.
%%
ifboolean
address.state = FL AND
( members_.interestdog = T OR
members_.interestcat = T )
"We have a special for your pet!"
""
%%
Example 2
You want to include a paragraph that goes to all Florida and Georgia residents whose interests are dogs or cats.
%%
ifboolean
( address.state = FL OR
address.state = GA) AND
( members_.interestdog = T OR
members_.interestcat = T )
"We have a special for your pet!"
""
%%
Example 3
You want to include a paragraph that goes to all Florida and Georgia residents whose interests are dogs or cats, but not if they have an interest in lizards.
%%
ifboolean
( ( address.state = FL OR
address.state = GA ) AND
(members_.interestdog = T OR
members_.interestcat = T) ) AND
members_.interestlizard <> T
"We have a special for your pet!"
""
%%
Example 4
You want to send a special message to all California residents who joined your list after March 1, 2017.
%%
ifboolean
address.state = CA AND
members_.DateJoined_ > 2017/03/01
"Special message!"
""
%%
Example 5
You want to send a special message to all northern California residents (designated by a range of zip codes) who have an interest in basket weaving. NOTE: if parentheses are used with quotes, a space must separate the parentheses and the quote.
%%
ifboolean
( ( address.zip > 91000 AND
address.zip < 95000 ) AND
members_.interest = "basket weaving" )
"Special message!"
""
%%
Example 6
You want to send a special a message to all AOL customers living in New York.
%%
ifboolean
members_.EmailAddr_ endswith aol.com AND
address.state = NY
"Special message!"
""
%%
Example 7
You want to send special content if member name information is blank they joined in the year 2000.
%%
ifboolean
members_.FullName_ = " AND
( members_.DateJoined_ >= 2000/01/ AND
members_.DateJoined_ <= 2000/12/31 )
"Special message!"
""
%%
Example 8
You want to send a message to everyone outside California.
%%
ifboolean
address.state <> CA
"Special message!"
""
%%
Note that you could also do this with the "ifcondition" command, with the message as your default text:
%%
ifcondition
address.state CA
<>
"Special message!"
%%