I have a button on the Preview ribbon. And when you click the button it generates an html email that marketing can copy into the email system that my company uses. My issue is that ExpandDynamicLinks() isn't working and it keeps throwing a /sitecore/notfound/... . So my next idea was to try to change the context of the field values from what is in the content editor to what is generated in preview (since preview does that for you). How can I change the context of my foreach (var field in Options.Fields){} to see the rendered preview fields?

  • And what is the code which you use to generate that html email used by your marketing? May 18 at 14:16
  • 1
    You can try to use Sitecore.Context.Site.SetDisplayMode(DisplayMode.Preview, DisplayModeDuration.ResetAfterRequest);, but you should update the question with the code, including why ExpandDynamicLinks() isn't working May 18 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.