Solved

How to change the font color for unsubscribe and manage preferences

  • 26 October 2021
  • 5 replies
  • 1698 views

Badge +4

How do I change the font color for unsubscribe and manage preferences link in a Klaviyo email template? I tried these combinations but the link color does not change. 

 

<p><span style="color:#D3D3D3 !important;">{% manage_preferences %}  |&nbsp; {% unsubscribe %}</span></p>
 

<p><span style="color:#D3D3D3;">{% manage_preferences %}&nbsp; |&nbsp; {% unsubscribe %}</span></p>
 

<p><a href="{% manage_preferences %}" style="color:#d3d3d3 !important;">Manage Preferences</a> | <a href="{% unsubscribe_link %}" style="color:#d3d3d3 !important;">Unsubscribe</a></p>

icon

Best answer by alex.hong 27 October 2021, 21:29

View original

5 replies

Userlevel 7
Badge +58

Hi there @GoodVibes123,

Thanks for posting to the Community! Hope to provide some info regarding editing the unsubscribe/preference links. 

To change to font color of the unsubscribe link, because it it set to a default color when you use the tag, there is a bit of code that needs to be added to override the default color. To do this we need to update the code within the Source of your Text block to the following:You will actually need to click into the text block with the unsubscribe tag. Go into the source code by pressing the 'source' button on the upper left of the editor, and use this line of code: 

<a href="LINK" style="color:#HEXCODE !important;">Link Text</a>. Of course, change the #HEXCODE portion to the color code that you want to appear.

For instance <a href="{% unsubscribe_link %}" style="color:#?????? !important;">Unsubscribe</a>

​All you have to do is add it to your Source code, change the code color, and add it to a live send.

The above HTML with inlined CSS snippet ensures that we are overriding the link color to black with the !important tag. The URL we are using can be referenced from our Template Tags doc.

I think the hardest part about implementing HTML and CSS is ensuring that all the syntax is correct when pasting it over and making sure you are adding it to the right areas.

We also have documentation regarding how to Customize a List's Unsubscribe Page that is worth checking out.

 

Let me know if that helped!
Alex

Badge +4

@alex.hong thank you for the help. I tried your source code and it worked however it didn’t work for the Manage Preferences tag that I have next to the Unsubscribe tag. See screenshot below. What is the source code if I want to have both of these tags side-by-side with the color #D3D3D3? 

 

Here’s the code I used: 

<a href="{% manage_preferences %}" style="color:#D3D3D3 !important;">Manage Preferences</a> | <a href="{% unsubscribe_link %}" style="color:#D3D3D3 !important;">Unsubscribe</a>

 

Here’s the end result preview:

 

Userlevel 7
Badge +58

Hey @GoodVibes123,

I see that in your code you used "{% manage_preferences %}" when it should be “manage_preferences_link”. The incorrect syntax is what is causing the html to be exposed on the frontend. I would suggest checking our help center docs again and it’s always best practice to double check syntax! These things rely on exact wording so there are no errors.

There is also a great community post regarding this as well:

 

Thanks!
Alex

Badge +3

I’m experiencing a similar issue as above.

 

When I use the following: <p><a href="{% manage_preferences_link %}" style="color:#454545!important;">Manage Preferences</a> | <a href="{% unsubscribe_link %}" style="color:#454545 !important;">Unsubscribe</a></p>

 

The links don’t function properly and show 400 bad request and the source is updated to: <p><a style="color: #454545 !important;" href="https://www.klaviyo.com/email-template-editor/{% manage_preferences_link %}">Manage Preferences</a> | <a style="color: #454545 !important;" href="https://www.klaviyo.com/email-template-editor/{% unsubscribe_link %}">Unsubscribe</a></p>

 

Then alternatively when I use the tag, I can’t seem to change the color from blue. 

 

I would like to just have a unsubscribe link in the correct color but can’t seem to manage it. 

 

Please help. 

Userlevel 7
Badge +58

Hey there @BriaTekla,

I would say that the code seems correct and the formatting looks accurate. Please double check for any additional/latent formatting issues that might be coming up. By chance, is there anything else playing with the code and what hex color they are using that could cause any disruption with how this code is being interpreted and injected into your form? It’s pretty easy to miss some minor syntax issues elsewhere that could disrupt the entire thing.

My recommendation is still to double check the code as it should pass correctly. If not, please reach out to a Klaviyo Partner to get some contracted developer assistance or to Support for a more in depth analysis into your account setup. 

 

Thank you!

Alex

Reply