Email Template Tag Styling

Soldato
Joined
18 Oct 2003
Posts
19,415
Location
Midlands
Hey all,

I have an email template (html) which pulls through a URL using a tag %URL%. The url is unique to the email going out and is all handled by the system. But, because the tag is entirely replaced by the URL I can't style the damn thing.

I've wrapped the %URL% in font tags and spans to no avail. It ends up being that bright blue default link.

It's not the end of the world but if anyone can think of a way around it, that would be great.

Cheers.
 
You could put the %URL% in a SPAN with a class on it, then use SPAN.myClass A { color: #C00; }

This may get ignored by some mail clients though.

*edit*
Just read your OP properly and you've already tried that - sorry.

I don't think there's any way round that unless you can get access to the code which inserts the link to be able to put a class or styling onto that.
 
I haven't actually tried using anything but in-line styles. That said, any styles that aren't in-line are usually stripped out by the mail clients, but worth a shot.
 
<a href="%URL%" style="xxxxxxxxx">%URL%</a>
I think gord's problem stems from the entire anchor element being substituted in for "%URL%", not just the URL.

If not, we've been grossly overestimating him all these years :D

I'd recommend Spunkey's method, backed by a massive slur campaign against GMail ;)
 
Last edited:
I think gord's problem stems from the entire anchor element being substituted in for "%URL%", not just the URL.

If not, we've been grossly overestimating him all these years :D

I'd recommend Spunkey's method, backed by a massive slur campaign against GMail ;)

Ok, could maybe put the %URL% into a table and apply formatting to the cell that contains %URL%
 
Ok, could maybe put the %URL% into a table and apply formatting to the cell that contains %URL%
No dice - the browser stylesheet will still apply its default anchor element styling.

Of all the methods of overriding the browser stylesheet, there's only one that gord can rely on in these circumstances [GMail excepted]: an embedded style declaration.

Coding e-mails: it's a fluffy world of joy :D
 
<a href="%URL%" style="xxxxxxxxx">%URL%</a>

That would end up with:
PHP:
<a href="<a href="link">link</a>" style="xxxxxxxxx"><a href="link">link</a></a>

I'm yet to try an internal style declaration. Turns out the system I am testing won't be fit for purpose anyway (perfect in every way apart from you cant change who the email is from), so I've got to try out another app. :( Third time lucky.
 
Back
Top Bottom