0

I have two WFFM forms. These forms uses a common custom save action to send a double opt-in email using the Sitecore EXM(Subscription Confirmation message). The double opt-in works fine and I receive an email with a confirmation link. On clicking the confirmation link, my contact is added to the List Manager contact list.

Now, the requirement is that when user fills the Form A and then clicks the confirmation link in the email, he should be redirect to Page A. Similarly, if user fills the Form B and clicks the confirmation link in the email, he should be redirected to Page B.

Basically, if user is filling the Webinar Form for example, then he should be redirected to webinar related page after confirming his email. Similarly, if user is filling the Product inquiry form, then he should be redirected to Product page after confirming his email.

I am working with Sitecore 8.2.2, EXM 3.4 and WFFM.

Thanks in advance.

1

In order to customize the Final Confirmation Page only for the subscription confirmation you would need to create your own custom ConfirmSubscription.aspx page. You can find the page in the EXM folder \sitecore modules\Web\EXM\.

If you take a look at the default implementation in the file Sitecore.EmailCampaign.Cd.dll (Sitecore.EmailCampaign.Cd.sitecore_modules.Web.EXM.ConfirmSubscription) you can modify the Redirect url based on your needs:

protected void Page_Load(object sender, EventArgs e)
{
   if (!ExmContext.IsEcmIdVerified)
   {
      this._logger.LogError("Attempt to access ConfirmSubscription with unverified url: " + this.Request.RawUrl);
   }
   else
   {
      string str = this.Request.QueryString[GlobalSettings.ConfirmSubscriptionQueryStringKey];
      if (!string.IsNullOrEmpty(str))
         this._clientApiService.ConfirmSubscription(new ConfirmSubscriptionMessage()
         {
            ConfirmationKey = str
         });
      string confirmativePageUrl = ExmContext.Message.ManagerRoot.GetConfirmativePageUrl();
      this.Response.Redirect(string.IsNullOrWhiteSpace(confirmativePageUrl) ? "/" : confirmativePageUrl, false);
  }
} 

If you want to customize the links that are sent in the email or change the path of the ConfirmSubscription.aspx page you need to override the SendConfirmationMessage method from the SubscriptionManager.cs class. You can see its implementation in the Sitecore.EmailCampaign.Cm.dll file:

public virtual bool SendConfirmationMessage(Contact contact, Guid recipientListId,
              ManagerRoot managerRoot)
{
   //sitecore implementation
   string url = this._hostnameMappingService.GetPublicUrl(WebUtil.GetServerUrl(), managerRoot) + "/sitecore%20modules/Web/EXM/ConfirmSubscription.aspx?" + GlobalSettings.ConfirmSubscriptionQueryStringKey + "=" + this.GetConfirmationKey(recipientListId, this._contactService.GetIdentifier(contact), managerRoot);
   //sitecore implementation
}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.