Set up double opt-in
With double opt-in, a sign-up on your site does not subscribe the customer straight away. Releva records the request, a workflow sends a confirmation email, and the customer is subscribed only when they open the link in it. Because your access token is public, this is also what stops someone who copies it from subscribing other people’s addresses.
The chain has four parts:
- The setting Subscription Request Behavaior is Wait for confirmation.
- Your site sends a subscribe request (
Releva.requestSubscribeorPOST /api/v0/subscribe/request). Releva answers202and records asubscribeRequestevent. - A triggered workflow on that event sends an email with the
{{subscribeLink}}merge tag. - The customer opens the link.
GET /api/v0/subscribe/oneclick/{payload}subscribes them with the subscriptions from the request and shows a confirmation page.
Before you start
Section titled “Before you start”- Subscription Management is Internal in Settings › Messaging. In External mode
{{subscribeLink}}renders empty, so double opt-in cannot work. - You have your shop’s access token (Settings › Shop & Integration; see Find your Access Token and Secret Key).
- The sign-up form collects an email address. The confirmation link subscribes by email address only, so a request with only a phone number cannot be confirmed through it.
-
Open Settings › Messaging and stay on the General tab.
-
Under Subscription Request Behavaior, select Wait for confirmation, then select Save. Step-by-step screenshots are in Choose how Releva manages subscriptions.
-
Open Workflows › Triggered and create a workflow.
-
Under Trigger on, select Event. Under Event, select Subscribe Request Submitted.
-
Under Campaign Scope, select a scope that reaches people who are not subscribed yet. Opt-in Marketing sends only to subscribed profiles, so it never reaches someone waiting to confirm. Opt-out Marketing reaches them unless they unsubscribed before. Transactional reaches them whatever their status; the admin warns never to use it for marketing messages, so agree the choice with whoever owns your privacy policy.
-
Add an Email step and put the
{{subscribeLink}}merge tag in its content, for example as the target of a “Confirm your subscription” button. -
Switch the workflow On.
-
Send the sign-ups from your site with
Releva.requestSubscribe(...)orPOST /api/v0/subscribe/request. Fields, responses and the SDK call are in Subscribe a customer from the browser.curl -X POST 'https://releva.ai/api/v0/subscribe/request' \-H "authorization: Bearer $RELEVA_ACCESS_TOKEN" \-H 'content-type: application/json' \-d '{ "email": "maria@example.com", "subscriptions": ["weeklyNewsletter"], "tags": ["footer-form"] }'
What the confirmation link does
Section titled “What the confirmation link does”{{subscribeLink}} points to /api/v0/subscribe/oneclick/{payload} on your shop’s click-tracking host. Releva builds the encrypted payload when it renders the email; you never build it yourself and it needs no authorization header.
- The payload carries the email address and, when the email was sent by a workflow triggered by
subscribeRequest, the subscriptions from that request. - Opening the link subscribes the customer and adds those subscriptions to their list. Without subscriptions in the request, your user-visible subscriptions apply.
- The page is in English only. After 10 seconds it redirects to your shop.
| Status | Page title | Text |
|---|---|---|
200 |
Subscribe Successful | Email address "maria@example.com" has been successfully subscribed. |
400 |
Subscribe Failed | The subscribe link you followed seems to be invalid. The link was changed or broken. |
500 |
Subscribe Failed | We encountered an internal error and were unable to subscribe you. |
Check it worked
Section titled “Check it worked”- Send a test sign-up with an address you control. The request answers
202with{}. - Open the profile under Data Platform › Profiles. The Recent Events tab lists a
subscribeRequestevent, and the profile is not subscribed yet. - Open the confirmation email and select the link. The Subscribe Successful page appears.
- Reload the profile. It shows Subscribed, with the requested subscriptions.
Troubleshooting
Section titled “Troubleshooting”The request answers 200 instead of 202. Subscription Request Behavaior is Subscribe right away. Change it to Wait for confirmation and save.
No confirmation email arrives. Check that the workflow is On, that its event is Subscribe Request Submitted, and that its Campaign Scope is not Opt-in Marketing.
The email arrives but the link is empty. Subscription Management is External. {{subscribeLink}} renders only in Internal mode.
The customer is subscribed without the requested subscriptions. The email that carried the link was not sent by a workflow triggered by subscribeRequest, so the link has no subscriptions in it. Send the confirmation from the triggered workflow.
Server-side subscribes skip the confirmation. POST /api/v0/subscribe and the Subscribe button on a profile always subscribe right away. Only storefront requests wait for confirmation.