CMS Development

eha
Member

How can I use smart content in a custom email module?

SOLVE

When building an HTML/HubL email template (i.e. not using the drag & drop interface), is there a way for me to write smart rules in HubL code as 'if' statements within a module?

0 Upvotes
1 Accepted solution
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

How can I use smart content in a custom email module?

SOLVE

Hi @eha

if you want to set smart rules based on contact/company settings you could try(never really done this) do it like this:

{% if contact.email == "SOME-EMAIL" %}
Content 1
{% elif contact.email == "SOME-OTHER-EMAIL" %}
Content 2
...
{% endif %}

 

To get all the right informations for properties simply open a rich-text somewhere, add a personalization token and copy it from the source-code view. 

 

best, 

Anton

Anton Bujanowski Signature

View solution in original post

0 Upvotes
1 Reply 1
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

How can I use smart content in a custom email module?

SOLVE

Hi @eha

if you want to set smart rules based on contact/company settings you could try(never really done this) do it like this:

{% if contact.email == "SOME-EMAIL" %}
Content 1
{% elif contact.email == "SOME-OTHER-EMAIL" %}
Content 2
...
{% endif %}

 

To get all the right informations for properties simply open a rich-text somewhere, add a personalization token and copy it from the source-code view. 

 

best, 

Anton

Anton Bujanowski Signature
0 Upvotes