Developer forum

Forum » Templates » Newsletter templates - tags for online/mail versions?

Newsletter templates - tags for online/mail versions?

Martin Christensen
Reply

Hey,

in a newsletter template I have a link to the online version of the newsletter in question, ie. "view in browser". However, I don't want the online version to include certain elements - like the link to view the online version :)

Are there any template tags that are appropriate to do a check on? I could do it easily with javascript, but I'd prefer to avoid that in emails.

I've tried a number of different email-related tags, some of which appear to be deprecated in 8.6. Maybe I'm going about this the wrong way..

Thanks!

//Martin


Replies

 
Sten Hougaard
Reply
This post has been marked as an answer

Hi Martin,

I would add a <!--@DwTemplateTags--> to the template and compare the output when rendered as a page and as an e-mail. They you may be able to wrap your content in a

<!--@If(onlineTag="")--> we are in a news letter <!--@Else--> we are online<!--@EndIf-->

Another approach could be to use Razor. You could then check for say a session. A session I guess would not exist in the newsletter path.

/Sten Hougaard

#forHire - contact @netsi1964

Votes for this answer: 1
 
Martin Christensen
Reply

Thanks Sten,

I ended up checking <!--@Server:Request.newsletterid--> , it seemed the neatest.

 

You must be logged in to post in the forum