This article explains how to set up automations in Omnisend to send an alternative double opt-in for selected segments.
Before You Begin
This feature uses Webhooks in automations, which are currently in closed beta and must be enabled by our support team. To do so, write a request to [email protected] with your use case.
How this works:
Contact enters a segment.
An automation is triggered that sends a double-opt-in email to the contact.
Contact clicks on any link in the email.
The “clicked on a message” event triggers an automation, which sends a webhook to subscribe to the contacts.
(optional) An additional block in the double opt-in flow, where if the email is not clicked in a set amount of time, they are unsubscribed.
Benefits
With the alternative double opt-in, you will be able to send a confirmation email to your audience regardless of where they originated from:
Third-party forms
Manual import
Checkout
Store signups
API
Setup Process
Step 1: Trigger Segment
Create a segment that, when contacts enter it, will send a double opt-in email. In our example, we will use the "Subscribed" segment, which contains all subscribed contacts.
You will want to adjust filters according to your needs; maybe not all subscribed contacts need a double opt-in, or only non-subscribed.
Step 2: Double Opt-in Email
Create an automation, you can name it "Double opt-in email".
Add a trigger "entered segment" and select a previously created segment. Then add an email and adjust it to represent a double opt-in email, specifically an add-a-button and a callout.
Your automation should look something like this.
After a delay, this optional section adds a webhook block and checks whether a button was clicked in the previous email. If the button is not clicked, it triggers a webhook.
The webhook has three main sections; here's what it should look like.
URL:
HEADERS:
x-api-key : <Your API key>
BODY:
{
"identifiers": [
{
"type": "email",
"id": "[[contact.email]]",
"channels": {
"email": {
"status": "unsubscribed"
}
}
}
]
}
You can remove the delay and split to instantly unsubscribe contacts who received a double opt-in email, so they would be subscribed only after they click on the email.
You can remove the unsubscription Webhook, so, for example, non-subscribed. Contacts would stay non-subscribed.
Copy the ID in the automation URL; it will be needed in the next step.
Step 3: Double Opt-in Subscription
Create an automation, you can name it "Double opt-in subscription".
Add a trigger "clicked on a message," select a filter "marketing activity ID," paste the ID of your "Double opt-in email" automation, and then add a webhook block like this.
URL:
HEADERS:
x-api-key : <Your API key>
BODY:
{
"identifiers": [
{
"type": "email",
"id": "[[contact.email]]",
"channels": {
"email": {
"status": "subscribed"
}
}
}
]
}
Step 4: Enable Automations
You're set. It's advisable to trigger the automation with a test contact to see if the email is received properly and if they are subscribed after clicking on the email.
Keep in Mind 💡 Integrating webhooks often requires development resources, especially for custom API setups, so ensure you have the necessary support.