Personalize email template colors based on user profile variable
Hi there,
I was wondering if anyone has experience customizing colors within an email template based on a user variable. I think this can be done with a custom module.
Based on the available documentation I've drafted this. The user variables in this instance are ABC, DEF, etc.
If you're creating a dictionary like what you have with colors, you can access those values by just using the keys that you created. So for example {{ colors.ABC }} will turn into #0070ba .
Depending on what your goal is, you could also create a field for this in your custom module, which might be a bit more user friendly. If you created a choice field and named it colors, you could create labels of ABC, DEF, GHI, JKL. Their respective values would be the hex codes. To use the value from that field you'd just use this: {{ module.colors }} . You could test things out like this: