hide webversion link on webversion

I had a quick search of the forum but couldn't see this mentioned.

What would be great is if there was a tag you could put around your webversion link and related content so that it can all be hidden when you are viewing the webversion.

We tend to use a yellow bar across the top of emails (copying the new UI fad that everyone seems to be into) but it looks a bit odd when you click the webversion link and you still get the big yellow bar suggesting you open it in your browser. I'd like to put a tag around the whole yellow bar table that would hide it on the webversion.


tshannon tshannon, 9 years ago

already fixed it!

Well a temporary workaround anyway, use javascript to hide the contents. No email clients (that I've ever heard of) run javascript, where as browsers do (ignoring the people that have it turned off)

Basically all you need is something like this:

<div id="problems">Problems viewing this email? <webversion>Click here to open it in your browser</webversion>.</div>

Dave Dave, 9 years ago

Thom, i wouldn't recommend that approach because some email clients (like Outlook) display a security warning if an email contains JavaScript, not to mention the fact that spam filters would definitely penalize it.

Great idea, but unfortunately there are some big drawbacks.

tshannon tshannon, 9 years ago

ah, very good point.

I'll hold out for the new feature then :)

vince, 9 years ago

Can the same thing be done using clever CSS that acts depending on browser types?
In essence, have a rule that hides the link if IE6, IE7, FF are the browser types?

tshannon tshannon, 9 years ago

No not really, you could try conditional comments to hide it in IE but I imagine it would also be hidden in outlook (and oe) when it's using IE as its rendering engine along with all webmail clients that let the comments through.

Stig Stig, 9 years ago

The best solution I can come up with right now, is to add a custom field, and set up your forms to automatically add something like " show" in it for every new subscriber.

You could then use this css:
.webversion {
  display: none;
  /* whatever formatting */
.show {
  display: block;

..and this markup:
<div class="webversion[customfield,fallback=]">Having trouble reading this newsletter? <webversion>Click here</webversion> to see it in your browser.</div>

This way, in the email, the "show" class will be pulled from the custom field, to override the "webversion" class and show the div. Since the custom fields are unavailable in the web version, the div will not be shown.

It's a hack, but it should work. If, for some reason, a subscriber has the custom field empty, the only thing that'll happen is that the div will be hidden.

The Campaign Monitor Blog – HTML email smarts to go with your good looks.
wim, 8 years ago

I've just tried the hack with the CSS and the custom field, but it didn't work, I'm afraid...

The custom field was available in the web version, so the div which was supposed to be hidden, was displayed like in the e-mail.

But perhaps I misunderstood something, because I don't see why you would need the "show" class...

PFG, 8 years ago

I create another page for the webversion

<webversion><span class="redbold12"><a href="http://www.companyname.co.uk/emailcampaigns/0811.html" target="_blank">visit here</a></span></webversion>

where http://www.companyname.co.uk/emailcampaigns/0811.html does not contain the "To unsubscribe" message.

Lewes, UK
wim, 8 years ago

Do you mean
1. you added a separate webversion in Campaign Monitor which you are linking to;
2. you created a web page on your own server which you are directing to from your Campaign Monitor mail?

If 1: doesn't that mean your click statistics are split in two: clicks on the mail on the one hand, clicks on the web version on the other?
If 2: you lose out on registering any clicks from within the web version, right? Or you're tracking those in some other way, again splitting your statistics in two.


PFG, 8 years ago

Morning wim -

No. 2 - Separate webpage on the clients server

The consequence is I know they have clicked to view the web version but then I don't know what links they clicked on within the main body of the page.

I accept the loss of information as I thought it looked "silly" to send someone an e-mail, give them the option of viewing the web version, then when they look at the web version give them the option of looking at the web version and so on.......

Lewes, UK
RafaelReyeros RafaelReyeros, 1 year ago

I know I am about 7 years late, but is there any solution to this question?

d.sturm d.sturm, 1 year ago

So, since I didn't found any CampaignMonitor internal solutions, I came up with following solution:

I changed the <body> tag in our template to:

<body class="[if:email][else]is-webversion[endif]"

and added these styles:

.is-webversion .webversion { display: none }

As the email field is available as default on all lists, you don't have to add a custom field. Opening the webversion, the email field will not be provided, so it adds the "is-webversion" class and hides the webversion link.

Additionally I used following <body> tag to add target="_blank" on all links in the webversion.

<body class="[if:email][else]is-webversion[endif]"[if:email][else] onload='javascript:(function(){for(var links=document.getElementsByTagName("a"),i=0,len=links.length;i<len;i++)links[i].target="_blank";})();'[endif]>

Hope this helps someone.


See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free