0 Comments

In my previous post – Leverage Sitecore xDB fro newsletter subscription I wrote last year, I talked about how to use EXM segment list to create newsletter subscription function.  If you haven’t read yet,  I recommend to read it first before starting to read this article.  In this article, I’m going to explain how to update user subscriptions by creating a form with WFFM and sending an EXM confirmation email with WFFM.

 

Recap the requirement

I’m going to start with a recap of the requirement.  Basically, client wants to manage their newsletter  subscriptions within Sitecore, and allows users to update their newsletter subscriptions on the website.

image

 

What has been architected

I created a form with WFFM for updating user newsletter subscriptions, and content editor is allowed to update the opt ins  i.e. Kids in the park (shown in screenshot above) as well as to map the opt ins with the custom newsletter subscription facets so as to automatically segmented user into corresponding email group. How to segment users  in EXM is not part of the scope of this post, but you can always refer back to my previous post.

 

Also, I created a custom action for sending the confirmation email which is defined within EXM, as well as a custom save action for updating contact subscriptions facets.

Here is the overview workflow diagram

image

 

Three Main Challenges

  • Initial form value based on contact subscription profiles on form loading.
  • Allow content editor to map option in with subscription facets in xDB.
  • Send confirmation email that defined in EXM.

image

Solutions for achieving each of the above listed challenges

  • Initial form value based on contact subscription profiles on form loading.

By default, WFFM allows you to initial the field value by passing value in query string. But we think it’s not best solution for rendering value with query string as :

  1. Potential safety issue
  2. Limitations in the length of query string
  3. Limitations in the filed type of WFFM

Therefore, we come up with the solution by creating custom field rules. How to create custom rule is not in scope, but you can find information on Sitecore documentation portal and it was also explained by Jeff Darchuk in here.

image
  • Allow content editor to map option in with subscription facets in xDB.

For mapping the optins, we create custom checklist field and utilizing the values as text feature for mapping the contact facets with each of the options in the checkbox list.

image

  • Send confirmation email that defined in EXM

A custom action has been created and here is the sample code for sending the EXM messages programmatically.

image