Mautic Community Forums

Email link formatting > Override Gmail defaults

Your software
My Mautic version is: 4.1.0
My PHP version is: 7.4

Your problem
Gmail formats links in emails and the only way to override Gmail formatting is to inline styles on the ‘a’ element. The automated links for emails, {unsubscribe_text}, {unsubscribe_url} and {webview_url} don’t expose the ‘a href’ tag which makes it impossible to style these links.

It would be great if we could add the style CSS inside the braces and have that incorporated,

I.E. {css:color: #ffffff !important;font-weight:100, unsubscribe_text}

Hi, this should point you in the right direction.

In short:
<a href="#" style="color: #555; ">example</a>

Hey Joey,

Yes, this is what I am saying. It has to be inline. But the Read Online and Unsubscribe tokens don’t expose the <a href.../> to put the style inline. It’s entered like this {unsubscribe_text}.

And, editing the unsubscribe text in the config would be global. In the event you want white unsub links for a specific email, it would essentially be white on every email template used.

Hi, you are right, I answered without reading the post properly.
Since your email is HTML, I suggest you make the proper changes in the header by adding css style to links. You can add a different class to all other links if you don’t want them to be affected.

Hi Joey,

Sorry, you’re still not following.

Gmail IGNORES any styles defined in the header regarding links. No classes or ID selector CSS code is going to solve this problem. This has to be done from within Mautic.

Yes, we can change the text used in those tokens however that is a global change and would apply to all parts of an email.

Hi,

I think Gmail as well as some other mail clients are stripping tags from emails. I think what you are looking for can already be done, just with a bit different approach. For example look below:

<a href="{unsubscribe_url}" style="color:red;">Test</a>

Text will stay red in Gmail. Hope it helps.

Regards, M.

Thanks all. My apologies as it never occurred to me to check for variables that I could use to manually build out those links.