Episerver Campaign allows users to communicate at scale with outbound messaging on channels such as email, SMS and push notifications. One common requirement is to sign up for a newsletter which is managed and distributed by Episerver Campaign and to ensure that the profile of a user is the available when clicking a link in a email that opens on another device such as a smart phone or even another browser.

This post describes how its possible to load recipient information for user from Episerver Campaign using the Episerver Campaign Connector based on an inbound link to a site. The following steps describe what needs to happen:

  1. Tag inbound links to the site from mails sent in Campaign to pass the mailId which is generated from the {bmMailId} field function
  2. Look up the recipient of the mailing using and populate the Campaign Connector profile
  3. (Optional) Associate the journey with profile in Episerver Insight

Tag links to the site in Campaign to pass the mailId

Use the {bmMailId} field function in Campaign to add a mailId querystring parameter to any links to the site:

Look up the recipient of the mailing using and populate the Campaign Connector profile

Episerver Campaign provides the MailIdWebservice. It allows developers to look up the recipient id (email) from the mailid value which is added in the step above. The code shows a global filter that can be added to base controllers or registered globally:

The code assumes that a Connected SOAP Service that references the Campaign SOAP service MailIdWebservice has been created in the solution. For reference the URL of the MailIdWebservice is https://api.campaign.episerver.net/soap11/MailId?wsdl.

Note a full project containing a working example of the code above can be found on Github.

(Optional) Associate the journey with profile in Episerver Insight

If the solution uses Episerver Insight then its possible to associate the current user journey using the email address retrieved. This has been described in a previous post Associating multiple Episerver Insight journeys on a single profile. The example project on Github also contains this code.

Seeing it in action

The following video shows the steps above in action:

It can be seen from the video that the form is re-populated with the entered form values. This may or may not be desirable and can be configured using Admin > Config tab > Marketing Connectors > Enable Auto-fill on forms. It should be noted that the same form profile information can also be used in Visitor Groups to personalise.

Getting it

The full code for enabling the functionality shown above can be found over on Github.



Recommendations for you