Detecting an EXM request

Abstract

Display different layouts by determining if EXM is requesting the message body or if it is a normal page request.

For the message body, you can use a different layout than for your usual webpages. To display the appropriate layout, you need to determine whether the EXM is requesting the message body or if this is a normal page request.

  • To detect an EXM request, you can use the HttpRequest extension method IsEcmRequest() in Sitecore.Modules.EmailCampaign.Core.Extensions.HttpRequestExtensions.

If the method returns true, EXM is requesting the message body, otherwise it is a normal page request.