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.

Thanks
Thom

tshannon tshannon, 8 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>
<script>document.getElementById('problems').style.display='none';</script>

Dave Dave, 8 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, 8 years ago

ah, very good point.

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

vince, 8 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, 8 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, 8 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, 7 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, 7 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.


Paul
Lewes, UK
wim, 7 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.

Thanks!

PFG, 7 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.......


Paul
Lewes, UK
RafaelReyeros RafaelReyeros, 7 months ago

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

d.sturm d.sturm, 4 weeks 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.

Cheers,
Daniel

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098