EXM 3.4

Hi!
I am trying to find information on how to add a unsubscribe link to an email campaign/newsletter.

I did find an article regarding ECM where you could add a link like this:

<a href="/sitecore/Unsubscribe.aspx">
  <unsubscribe>
     <sc:Text runat="server" Field="Unsubscribe" Item="<%# this.DataSource. %>" />
  </unsubscribe>
</a>

and this link should then be transformed to

<a href="yoursite/.../RedirectUrlPage.aspx>                          
  <unsubscribe>Unsubscribe</unsubscribe>
</a>
Are there a simular approach in EXM 3.4?

Regards

Patrik
  • The links in a newsletter (not a test newsletter) are always transformed to the RedirectUrlPage.aspx. You can overwrite those settings in a custom config:

    <pipelines>
      <modifyHyperlink>
        <processor type="Sitecore.Modules.EmailCampaign.Core.Pipelines.GenerateLink.Hyperlink.SkipAlreadyProcessedHyperlink, Sitecore.EmailCampaign">
          <RedirectPagePath>/newsletter/RedirectUrlPage.aspx</RedirectPagePath>
        </processor>
        <processor type="Sitecore.Modules.EmailCampaign.Core.Pipelines.GenerateLink.Hyperlink.GenerateHyperlink, Sitecore.EmailCampaign">
          <RedirectPagePath>/newsletter/RedirectUrlPage.aspx</RedirectPagePath>
          <UrlQueryKey>ec_url</UrlQueryKey>
        </processor>
      </modifyHyperlink>
    </pipelines>

    or overwrite the OpenHandler Path:

    <settings>
      <setting name="EXM.OpenHandlerPath">
        <patch:attribute name="value">/newsletter/RegisterEmailOpened.ashx</patch:attribute>
      </setting>
    </settings>

    In our case we blocked the "sitecore"-folder in IIS, so we need a different location to make EXM work ;)

    Best regards

  • In reply to Dirk Schäfauer:

    Can i create this custom config? Or just add this <pipelines> patch to an existing EXM config file?
    I'd prefer all links left as we've done them - as the re-directs are causing issues with unsubscribes or funky links with UTM campaign traits.
  • In reply to David Silva:

    We always leave the configs as they are. So we add a patch to an existing EXM config. Those settings and pipelines are in Sitecore.EmailExperience.Core.config.

    Best regards 

  • In reply to Dirk Schäfauer:

    Can anyone please reply to the question I posted on the below link with regards to the exact scenario described in this chain?
    stackoverflow.com/.../how-to-prevent-sitecore-exm-newsletters-from-transforming-links-to-redirecturlpa

    When you say "The links in a newsletter (not a test newsletter) are always transformed to the RedirectUrlPage.aspx. You can overwrite those settings in a custom config" I'm basically wondering exactly how. My question on stackoverflow describes what I have so far. Thanks!

    Emad
  • In reply to Dirk Schäfauer:

    Hi Dirk

    Thanks for the hint.
    How do you implement the /newsletter/RegisterEmailOpened.ashx page so that data is being tracked in EXM?
    Or is it possible to copy the RedirectUrlPage.aspx page to another location in the web folder, would that work?
  • In reply to Mats Lindberg:

    Hi Mats,

    we copied both RedirectUrlPage.aspx and RegisterEmailOpened.ashx to a folder called "newsletter" in the webroot and patched the specific config files.
    Because in a hardened environment the "/sitecore" folder might not be available or has security rights.

    Config looks like this:

        <pipelines>
          <modifyHyperlink>
            <processor type="Sitecore.Modules.EmailCampaign.Core.Pipelines.GenerateLink.Hyperlink.SkipAlreadyProcessedHyperlink, Sitecore.EmailCampaign">
              <RedirectPagePath>/newsletter/RedirectUrlPage.aspx</RedirectPagePath>
            </processor>
            <processor type="Sitecore.Modules.EmailCampaign.Core.Pipelines.GenerateLink.Hyperlink.GenerateHyperlink, Sitecore.EmailCampaign">
              <RedirectPagePath>/newsletter/RedirectUrlPage.aspx</RedirectPagePath>
              <UrlQueryKey ref="settings/setting[@name='QueryStringKey.RedirectUrl']/@value" />
            </processor>
          </modifyHyperlink>
        </pipelines>
        <settings>
          <setting name="EXM.TargetHostName" value="http://site.local" />
          <setting name="EXM.OpenHandlerPath">
            <patch:attribute name="value">/newsletter/RegisterEmailOpened.ashx</patch:attribute>
          </setting>
          <setting name="EXM.CheckRecipientListsCount">
            <patch:attribute name="value">true</patch:attribute>
          </setting>
          <setting name="StandardMessages.SubscriptionNotification">
            <patch:attribute name="value"></patch:attribute>
          </setting>
        </settings>