How do I show different content based on lead data?

Modified on Tue, 5 May at 11:34 AM

How do I show different content based on lead data?

Personalize emails, SMS, and pages without creating multiple templates. Hubhus's @if/@else logic lets you show or hide content based on any lead field, select value, assigned person, postal code, event data, and more.

TL;DR

Use @if(condition){ content }@endif or @if(condition){ ... }@else{ ... }@endif. Any Hubhus placeholder can be the condition. Operators: == != ~= (contains) >= <=. Combine with || and && — note: || evaluates before &&, parentheses not supported.

4 things to know

1

Basic show/hide

@if(%assigned_person_name%){
  Your consultant: %assigned_person_name%
}@endif
2

If / else with comparison

@if(%lead_postal_code% >= 6000){
  We cover your region.
}@else{
  Contact our central office.
}@endif
3

Contains check (~=)

@if(%lead_email% ~= @gmail.com){
  You are using a Gmail address...
}@endif

~= is case-insensitive contains check.

4

Select field value check

@if(@select[select_customer-type,slug] == commercial){
  Business pricing applies.
}@endif

Use the field slug (e.g. select_customer-type) not the display label.

Read more

All supported operators

== exact match  |  != not equal  |  ~= contains (case-insensitive)  |  >= <= > < numeric/date comparisons

Logical operators: || (OR) and && (AND). Note: || evaluates before &&. Parentheses are not supported.

@if(%lead_type% == business || %lead_type% == vip){
  Special info block
}@endif

What counts as FALSE (no content shown)

Empty string, 0, false, off, nej, no. Anything else is truthy. A placeholder that hasn't been filled evaluates to empty = false.

Nested conditions and chaining

@if(%lead_postal_code% >= 1000 && %lead_postal_code% <= 2999){
  Copenhagen area message
}@else{
  General message
}@endif

You can chain multiple @if blocks to handle more than two cases. Use the template editor's preview with real leads to verify your logic evaluates correctly.

Common searches

@if logic template • conditional email content • show hide content lead • @else Hubhus • dynamic email personalization

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article