I have a requirement to send an email with View in Browser
link. On clicking the link, it has to open the mail in browser. We need to implement this by using EXM Template.
Is there a solution for this in Sitecore EXM?
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityI have a requirement to send an email with View in Browser
link. On clicking the link, it has to open the mail in browser. We need to implement this by using EXM Template.
Is there a solution for this in Sitecore EXM?
In a default installation, the Email Experience Manager (EXM) contains a number of predefined templates and import options. One of the predefined template is Newsletter : a template with a header containing a link to the online version of the email campaign and a footer with links to opt-out pages.
If you download EXM 3.4.2 from: https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_34/Email_Experience_Manager_34_Update2.aspx
you will see inside the package Email Experience Manager 3.4.2 rev. 170713 NOT SC PACKAGE.zip a zip file with the next name. Email Experience Manager Sample Newsletter 3.4.2 rev. 170713.zip . On this zip file is an example how to view newsletter in browser.
Normally you add the link in the header of the newsletter in this way:
@if (Request.QueryString["sc_pd_view"] != "1")
{
<div style="margin: 10px 0; font-size: 10px; font-family: @Model.NewsletterOptions.FontFamily">
@Html.Sitecore().Field(Templates.Header.Fields.ViewOnlineHavingTrouble, Model.ContentItem)
 
<a href="/?sc_itemid=@Sitecore.Context.Item.ID&sc_lang=@Sitecore.Context.Language.Name&sc_pd_view=1">
@Html.Sitecore().Field(Templates.Header.Fields.ViewOnlineClickHere, Model.ContentItem)
</a>
</div>
}