Expand my Community achievements bar.

SOLVED

How to create dynamic content?

Avatar

Level 7

Hello!

 

I want to create dynamic content with different structures. For one business unit show one photo and two buttons and for another business unit two photos and one button.

 

In understand that this has to be made using personalization blocks but it could be done inserting conditional content.

 

Thanks for your help!

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ccg1706 

What do you mean by "conditional content" ?

You can use the personalisation syntax to generate content according the message datas :

<% switch( recipient.field1.toString()){
 case "CASE1" : %>
<p>My content CASE1</p><img src="...pic1.jpg"/>
<% break;
case "CASE2" : %>
<p>My content CASE2</p><img src="...pic2.jpg"/>
<% break;
default : %>
<p>My content default</p><img src="...picDefault.jpg"/>
<%}%>

 

You can also choose to make 2 differents delivery models, if you can split your target in a workflow, then send those 2 differents deliveries with an upstream targeting workflow. It depends of the complexity in the difference between your 2 business cases.

 

Also, you can use the content management module to build complex delivery content : https://experienceleague.adobe.com/docs/campaign-classic/using/sending-messages/content-management/a...

It's more difficult to handle (you have to master XSL or JST) but can achieve great things.

Cedric

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi @ccg1706 

What do you mean by "conditional content" ?

You can use the personalisation syntax to generate content according the message datas :

<% switch( recipient.field1.toString()){
 case "CASE1" : %>
<p>My content CASE1</p><img src="...pic1.jpg"/>
<% break;
case "CASE2" : %>
<p>My content CASE2</p><img src="...pic2.jpg"/>
<% break;
default : %>
<p>My content default</p><img src="...picDefault.jpg"/>
<%}%>

 

You can also choose to make 2 differents delivery models, if you can split your target in a workflow, then send those 2 differents deliveries with an upstream targeting workflow. It depends of the complexity in the difference between your 2 business cases.

 

Also, you can use the content management module to build complex delivery content : https://experienceleague.adobe.com/docs/campaign-classic/using/sending-messages/content-management/a...

It's more difficult to handle (you have to master XSL or JST) but can achieve great things.

Cedric

Avatar

Level 7

Hi Cedric!

 

Thanks for your quick response, by conditional content I meant to apply this.

<%

if(recipient.data=='condiiton'){

%>

<%

}

else{

%>

But having your two proposals I'm going to try doing it that way.

Thanks for your help!

 

Avatar

Community Advisor

Cedric's answer is correct, a switch case statement is an alternative  way to handle 'IF' conditions based on cases.

 

More info.

https://dev.to/sumusiriwardana/if-else-or-switch-case-which-one-to-pick-4p3h

 

Avatar

Level 7

Hi @david--garcia,

 

Thanks for your response and your additional link with more information and explanations . I was able to solve the problem by applying the switch case structure.

 

Have a nice day!