How to send favorite colors/color template in AJO? | Community
Skip to main content
Level 2
June 11, 2024
Solved

How to send favorite colors/color template in AJO?

  • June 11, 2024
  • 1 reply
  • 497 views

Hello,

 

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

 

Thanks. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by IvanMi1

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/personalization/functions/helpers#let

 

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. 

1 reply

IvanMi1Adobe EmployeeAccepted solution
Adobe Employee
June 11, 2024

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/personalization/functions/helpers#let

 

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.