Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > online version of newsletter link in newsletter View modes: 
User avatar
Member
Member
gatsby0121 - 9/26/2011 11:36:26 AM
   
online version of newsletter link in newsletter
In my newsletter template, I'm inserting a link "click here for online version" and in the href I use {%issueid%}.

In the preview for the newsletter, it works.

However I also save a copy of the newsletter to a file using issueprovide.getemailbody.

I thought that the newsletter would be saved with the {%issueid%} replaced, as in the preview, but that's not the case.

So how do I save a copy of the emailbody, with the issueid, or other macros saved?

User avatar
Member
Member
kentico_michal - 9/27/2011 3:32:43 AM
   
RE:online version of newsletter link in newsletter
Hello,

Could you please try to use the IssueHelper.ResolveMacros method, as you can see in the following code snippet:


object[] data = new object[3];
data[0] = issue;
data[1] = sb;
data[2] = news;

htmlPage = IssueProvider.GetEmailBody(issue, news, null, sb, true, CMSContext.CurrentSiteName, null, null, null);
htmlPage = IssueHelper.ResolveMacros(data, htmlPage, culture);


Anyway, the code which generates the Preview HTML code can be found in the following file so you can take a look how it is implemented: ~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_ShowPreview.aspx.cs.

Best regards,
Michal Legen