Skip Navigation

Kentico Extensibility: How to Enable Double Opt-In with Kentico Forms

Kentico EMS provides the ability to use double opt-in with email sign-ups. When this feature is enabled, Kentico verifies that an email is valid and that its owner really wants to receive a newsletter. It does this by sending an email confirmation link that the user must open. 

This is a great feature because it protects email lists from having invalid email addresses and protects users from being signed up without their consent. Double opt-in reduces the risk of bounced emails as well as the risk of users reporting messages as spam. In short, using Kentico's double opt-in feature will protect your email sender reputation.

When using the newsletter subscription web part or widget, Kentico's double opt-in feature works out-of-the-box. However, marketers may want to use custom online forms for newsletter sign up so that they can ask for additional information. In this case, a marketer would typically create a Kentico online form, and then create a marketing automation workflow that adds emails from the form to the subscription list.

Here is an illustration of a very simple marketing automation workflow that checks the value of the form’s confirmation box and then adds the submitted email address to a newsletter:

However, if using marketing automation to populate newsletter subscriptions lists in Kentico 12 or earlier, marketers will discover that Kentico’s double opt-in feature is not used. Subscribers that are added using a Kentico form via marketing automation are automatically marked as “confirmed.”

This could be a startling surprise for marketers, who may have assumed that Kentico’s double opt-in feature would work in conjunction with online forms.

However, the good news is that this issue has been resolved in Kentico 12 Service Pack. Additionally, if you are still running an earlier Kentico version, there’s still good news: Because Kentico is highly extensible – that is, its robust API makes it easy add and customize functionality – there is a simple way to enable this feature using a custom marketing automation action.

Custom marketing automation action

A custom action is a type of workflow step that is executed in a marketing automation workflow. By creating a custom action, we can replace the out-of-the-box “Newsletter subscription” action with one that instead uses the double opt-in confirmation option. Kentico provides a great overview on developing custom marketing automation actions. The basic idea is to create a custom .NET class that is derived from CMS.Automation.AutomationAction and implements a custom Execute() method. The custom action can also have custom properties, so that it can be configured in the workflow designer.

When we created the custom Newsletter subscription action, it was easiest to start by decompiling the out-of-the-box version, CMS.Newsletters.NewsletterSubscriptionAction, which clarified what was missing in the out-of-the-box code: When creating the SubscribeSettings object, the AllowOptIn and SendConfirmationEmail properties were always set to false.

SubscribeSettingssubscribeSettings=newSubscribeSettings
{
 SendConfirmationEmail=false,
 RemoveAlsoUnsubscriptionFromAllNewsletters=false,
 AllowOptIn=false
};

To serve our purposes, we were able to create a basic version of this marketing automation action that instead set the AllowOptIn and SendConfirmationEmail properties to true.

Register the custom action

After creating a new custom marketing automation action, it’s necessary to register it with Kentico in the Marketing Automation module. The registration requires a unique code name, an assembly name containing the custom action, and a fully-qualified class name.

Once the custom action is registered, you will then be able to use it in the marketing automation workflow designer to register newsletter subscribers:

After implementing the workflow using the new custom action, new subscribers are added with the “Waiting for confirmation” status:

This is just one of the many examples of Kentico’s support for deep customizations. The platform’s extensibility, probably its best kept secret, continues to allow us to meet the unique needs of our customers, when the limitations of many other platforms would have stopped us in our tracks.

Want to learn about more examples of Kentico’s extensibility? Check out my recent article here. You can also drop me a line on Twitter (@tiriansdoor), or contact our BlueModus team of experts today.

Interested? Contact Us

Interested?

Send us a message using the form below or call us at 303.759.2100

Thanks for Reaching Out

We'll get in touch with you soon. In the meantime, please try to remain calm.

Location

1641 California Street #400, Denver, CO 80202
(on California Street between 16th and 17th Streets)

Hours

Weekdays from 8:00 AM – 5:00 PM MT

Call Us

If you have any issues, call us at 303.759.2100

Access

Facing the front entrance of the building, there are two keypads:

  1. Using the silver keypad, press 002 to call BlueModus.
  2. A BlueModus colleague will answer and then buzz you in the door.
  3. Walk in straight ahead to the elevator.
  4. Take the elevator to the 4th floor.

Parking

There are several nearby parking lots that charge daily or hourly rates, including one directly next to our building. Additionally, there is metered street parking in the area. Typically, credit cards are accepted for all area parking.