Create a customized double opt-in process

Tools: Make (Integromat), Airtable (free plan)

Most newsletter tools do include a double opt-in process, however the form builder for the sign-up forms is often so crappy that it makes the tool unusable for me.

And since I don’t know CSS/HTML, I just developed the double opt-in process myself and used a wordpress form for my newsletter list.

This process works as follow:

As soon as we receive data, the database (in my case Airtable) is scanned to see if the contact already exists and if he has already confirmed the double opt-in. If the contact exists but has not yet confirmed, they will receive a confirmation email. The same goes for contacts that don’t exist yet, but are created through the process.

Let’s dive in.

Create your contact database

In my case I use Airtable as the contact database.

It stores only the email address, the double opt-in confirmation and sets the date when the contact registered. Because I don’t need more information for my newsletter.

So it looks like this:

And that’s it for the database.

Building the double opt-in scenarios in Make

The double opt-in process consists of two scenarios.

In one scenario, the double opt-in email is sent and, if necessary, the user’s record is created.

The second scenario receives the double opt-in confirmation and updates the user’s record in the database.

Creating the scenario for sending the double opt-in link

We first receive data via a webhook. Which is added to a form in the wordpress editor.

After that, want Airtable to check if the record exists. For this we use the Airtable module “Search Records”.

To begin, we connect our Airtable account. We select our base, table and view and add the formula “{Email}=”{{}}” (the “” in the second bracket is the email “data” we get from the webhook).

This formula is our unique identifier. This means that Airtable looks for the email to check if the record exists, because in this case the email can only be associated with a single contact.

The next step in the scenario is to place a router that allows us to choose different paths.

We start with the first path of the router. Which should be chosen if the contact does not exist yet.

To do this, we first add the Airtable module “Upsert a Record” (you can also use the “Create a Record” module for this).

We connect our Airtable account again. Select the base and the table and enter the data we got from our webhook. In my case, it’s just the email address.

We set the “Double Opt-In” field to “No “and enter the timestamp “now” in the date field.

The time stamp “now” can be found in the “Date and time” functions.

What happens here is that when the contact is created, each time this operation is performed, the timestamp of the execution time is added to the Airtable database in the “Date” field.

The last thing we want to do is add a mail module that will send the email with the opt-in link to our user.

We add our email account and then we add the user’s email address that we get from our webhook. Finally we add our text in the subject and content field.

As you can see in the content box, my double opt-in confirmation link is a webhook address. I will explain later how this works and how to create it.

Now we need to set up the filter to run the process this way when the contact does not exist.

To do this, we use the filter in front of the Airtable module after the Router.

The condition is “if the email address is not in the database, then take this route”.

It looks like this:

That’s it for the first route.

To build the second route, we only need a mail module and a filter.

To set up the mail module, we can clone the first mail module and make some adjustments to the text (if desired).

Otherwise it will look like the other one:

To ensure that our process runs this way when the contact already exists but has not yet confirmed the double opt-in, we need to set up the filter after the router in the second path:

The condition here is “double opt-in (data comes from the first Airtable module) does not exist AND the mail address (data from the webhook) is the same as the email address in the Airtable database (data from the first Airtable module)”:

This is it for the first scenario.

Creating the scenario for updating the double opt-in consent in the database

This scenario is responsible for confirming the double opt-in consent in the database once the confirmation link is clicked and redirecting the person to a confirmation page afterwards.

We will also start with the “Custom webhook” module. This will be the link in the email that must be clicked to confirm the double opt-in.

I explain this in the section “How to connect both scenarios”.

The second module we need is also a Webhook module. The “Webhook response” module.

This will redirect the user to the confirmation page after clicking the double opt-in link.

To do this, we add “303” to the status field of the module to tell Make that we are seeking a redirect. There are many other options that can be used here – all status messages can be found on the official website.

After that, we enable the advanced settings and add a custom header with the “Location” key and the redirect URL as the value (in my case, it’s simply the URL of my website, since I haven’t created a confirmation page yet).

The next module we need is the Airtable “Search records” module.

This will search our database for the correct record to update.

Here we enter basically the same information as in the first scenario. Connect our database, choose the right base, table and view.

The Formula field remains empty for now.

Now we need another airtable module.

For this we use “Upsert a Record” because we want to update an existing record.

We choose the correct base and table again. Take the record ID and date from the previous Airtable module, check “Yes” for the double opt-in box and leave the email field blank for now.

Finally, we add a mail module that sends a confirmation after the user clicks on the double opt-in link.

So we reconnect our email account, take the email record from the first Airtable module and fill in our content.

That’s it.

Both scenarios are set up.

Now we have to connect them together.

How to connect both scenarios?

To connect both scenarios, let’s go to our second scenario.

We open the first webhook module and copy our webhook.

Now we return to our first scenario.

We open our mail modules. In the content field we paste our webhook as confirmation link.

However, we also want this scenario to pass on the recipient’s email address once the link is clicked.

So we add “?email={}” (“” in brackets is the data we took from the first webhook module in the first scenario) at the end of our webhook URL.

Here’s what that looks like:

The same applies to the other mail module.

Now we can test our scenarios.

If we now return to our second scenario, we can see that after someone clicked on the confirmation link in the mail, the email address was passed to the webhook.

This means that we can now use the mail address in this scenario to complete our workflow.

So we jump into the Airtable “Search Records” module and enter our formula to make sure we are updating the correct record.

And finally, we also update the second Airtable module and enter the email data into the email field.

That’s it.

Both scenarios are connected via webhook and we have build our customized double opt-in process.

Get this scenario for free:

Download Scenario 1
Download Scenario 2

How can I use this?

Share this post: