Expand my Community achievements bar.

SOLVED

How to send favorite colors/color template in AJO?

Avatar

Level 2

Hello,

 

Is there a way to set favorite colors or a color template in AJO?

 

Thanks. 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Depends on how you want to use the colors etc. What I have found works really well is to have a list of HTML Hex Colors saved in an expression code fragment. You can then give the colors a variable name so that when you are building your HTML email templates you can replace the color value with the value from the fragment. i.e. 

 

 

{% let BrandPrimary = FF0000 %}
{% let BrandSecondary = 002395 %}

 

 

Then in your HTML can you do include the fragment in your template and call in the different colors by names.

 

<style>
    .div-1 {
        background-color: #{{BrandPrimary}};
    }
    .div-2 {
    	background-color: #{{BrandSecondary}}; }
</style>

<body>
    <div class="div-1">Something </div>
    <div class="div-2"> something else </div>
</body>

 

 

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...

 

Then if you need to update the color definitions or add/change them you can do it in one place, within the fragment and have it apply everywhere the fragment is used. 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Depends on how you want to use the colors etc. What I have found works really well is to have a list of HTML Hex Colors saved in an expression code fragment. You can then give the colors a variable name so that when you are building your HTML email templates you can replace the color value with the value from the fragment. i.e. 

 

 

{% let BrandPrimary = FF0000 %}
{% let BrandSecondary = 002395 %}

 

 

Then in your HTML can you do include the fragment in your template and call in the different colors by names.

 

<style>
    .div-1 {
        background-color: #{{BrandPrimary}};
    }
    .div-2 {
    	background-color: #{{BrandSecondary}}; }
</style>

<body>
    <div class="div-1">Something </div>
    <div class="div-2"> something else </div>
</body>

 

 

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...

 

Then if you need to update the color definitions or add/change them you can do it in one place, within the fragment and have it apply everywhere the fragment is used.