Conditional Logic
Knowledge Base
One of Postaga’s more advanced features is the ability to use conditional logic in your email templates.
This lets you insert text in your outreach emails only if specific conditions occur.
When to Use it
A great use case for this is when you want to say something different if you’re sending the email to a generic email address vs. a specific person.
For example, if you cannot find a specific person’s email and only have a generic email address (e.g. an info@ or contact@ address), you might want to say in your message, “Hey, I don’t have an email for a specific person – can you point me to the right person to speak with?” But, if you can find a specific contact’s email address, you would not want them to get that message.
Another example could be, if you are sending an email in a Skyscraper campaign and you want to mention that someone is linking to an old blog article that is several years old, but only if that article is more than 1 year old. You can do that as well.
Conditional Logic Example
Here’s an example of how conditional logic in Postaga looks (don’t be scared if it looks hard to understand, we’ll explain it all below):
Here’s what we’re doing:
This message is meant to have different content depending on whether the contact is generic or not.
If the contact is generic, we are going to first ask them for the right person to speak with. If the contact is not generic, we are going to mention that contact by name and keep going with our outreach pitch.
Here is what the actual sent email will look like:
IF the email address is generic
IF the email address is not generic
How it Works
Now, let’s break down some specific examples.
Conditional logic works using IF statements.
In plain English, “If these conditions occur, then this specific text will display.”
Basic Example
Let’s say we want to show certain text like, “Hello,” if the contact’s email is a generic email, like [email protected]:
{{IF(contact_generic_email)}}Hello,{{ENDIF}}
- contact_generic_email is the Merge Field whose value we want to get (and this can be swapped for any merge field). If we have only a Merge Field name, we’re asking if that Merge Field exists or is true
- “Hello,” is what we show if the IF statement is true
In plain English, this means, “If there is a value for contact_generic_email, then we’re going to show ‘Hello,’.”
Intermediate Example
Now let’s do the opposite.
Let’s say, “Hey [first_name],” if the contact’s email is NOT a generic email:
{{IF(contact_generic_email!)}}Hey {{contact_first}},{{ENDIF}}
- contact_generic_email is the Merge Field whose value we want to get
- ! after contact_generic_email is the FALSE operator. We’re asking if that Merge Field is FALSE
- “Hey [contact’s first name],” is what we show if contact_generic_email is FALSE
In this example, we added an “operator” to the IF statement, which in this case is the ! value.
Advanced Example
Let’s do another example, using something that is not a simple binary true or false, and getting a bit more into advanced territory to show you what you can do with conditional logic in Postaga.
In this next example, we want to mention in our message that our contact is linking to an old and out of date article IF the date the article was published was before 2020.
Here is what that would look like:
{{IF(target_year<2020)}}This is an old article from a few years ago.{{ENDIF}}
Let’s break down the different parts. You have the IF statement at the beginning, and ENDIF at the end, same as last time. Then:
- target_year is the Merge Field whose value we want to get (in this case, the year of the published blog post)
- < is the comparison operator (in this case, the “less than” symbol)
- 2020 is the value that we’re comparing target_year to (in this case, the year 2020)
- “This is an old article from a few years ago.” is what we show if the IF statement is true
So, in plain English, this means, “If target_year is less than 2020 (meaning the target article in a Multiscraper campaign was published before 2020), then we’re going to show ‘This is an old article from a few years ago.'”
Operators
Here’s the full list of operators that you can use in these IF conditionals:
- No operator
- If the merge field value exists
- Ex: {{IF(contact_first)}}
- !=
- If the merge field value does not equal the value in the comparison
- Ex: {{IF(target_year!=2021)}}
- !
- If the merge field value is false
- Ex: {{IF(contact_first!)}}
- <=
- If the merge field value is less than or equal to the value in the comparison
- Ex: {{IF(target_year<=2021)}}
- >=
- If the merge field value is greater than or equal to the value in the comparison
- Ex: {{IF(target_year>=2020)}}
- =
- If the merge field value is equal to the value in the comparison
- Ex: {{IF(target_year=2021)}}
- <
- If the merge field value is less than the value in the comparison
- Ex: {{IF(target_year<2021)}}
- >
- If the merge field value is greater than the value in the comparison
- Ex: {{IF(target_year>2020)}}
Putting It All Together
After your {{IF}} statement, add the content that you’d like to show if the IF statement evaluates to TRUE.
And finally, end the IF statement with {{ENDIF}}.
So, you have {{IF}}CONTENT{{ENDIF}}.
That’s it! Now you can add conditionals to your emails!
Free 14-Day Trial
Start building relationships now with your fully-featured 14-day trial!
How We Compare
Terms | Done-For-You Terms | Privacy | Write For Us | Press
© 2024 Postaga. All Rights Reserved. Made with in Boston.