Noptin can send SMS notifications through Twilio whenever a new-post notification or post digest finishes generating.
This tutorial creates an automation that:
- Detects when Noptin finishes sending a generated newsletter.
- Identifies the new-post notification or post digest that generated it.
- Loops through your subscribed contacts.
- Reads each subscriber’s phone number from a custom field.
- Sends an SMS containing a link to the browser version of the newsletter.
Requirements
Before you start, you’ll need to install the latest version of Noptin and the Twilio add-on.
You’ll also need a Twilio account with an SMS-capable phone number or Messaging Service and a phone-number custom field in Noptin.
Tip:
Ensure every recipient gives explicit consent before you send them SMS messages.
To do this, create a checkbox custom field in Noptin. You can then use this field in the conditional logic settings for your automation.
Step 1: Create a subscriber phone-number field
To do this, visit Noptin > Settings > Custom Fields and add a custom subscriber field for storing phone numbers.

The field name does not have to be "Phone Number", but remember the name you set because you will use it in the Twilio action.
Your subscribers’ phone numbers should use the international E.164 format, such as:
+14155552671
Step 2: Connect Noptin to Twilio
After installing the Twilio add-on, open Noptin → Settings → Integrations → Twilio and enter your Twilio account SID and auth token.

Step 3: Create the email automation
Next, create the email that Noptin will turn into a browser-viewable newsletter.
You can either create a New Post Notification…
… or a Post Digest automation.
Step 4: Note the automated email’s ID
Go to Noptin > Emails > Automated Emails. Locate the campaign you created earlier and note the ID shown below it.

We will use this ID to ensure the SMS automation responds only to newsletters generated by this particular email.
This is especially important when the site has several newsletters, post digests, or new-post notifications.
Step 5: Create the SMS automation rule
Open Noptin > Automation Rules, then click the Add New Automation button to open the automation rule creation screen.

Search for “sent” in the search box. Next, select the Newsletter Sent automation trigger.

This trigger runs after Noptin finishes sending the generated newsletter.
It also makes information about the generated newsletter available through campaign merge tags, including its browser-view URL.
After selecting this trigger, Noptin asks you to set a campaign ID and a parent campaign ID. These settings determine which newsletters trigger the automation rule.
If you do not set these, the rule will run for every newsletter sent. For this setup, leave the campaign ID blank and enter the ID we copied in step 4 into the parent campaign ID field.

Tip:
We only set the parent campaign ID because it matches the automated email ID.
When a new post notification is triggered, Noptin creates a new newsletter for that notification and assigns the automated email’s ID as the newsletter’s parent campaign ID.
After setting the parent ID, click Choose an action to open the action selection screen. Search for Loop, then click Set up.

Noptin will then display the loop settings. Configure the loop to iterate over Noptin subscribers, as shown below.

You can also use the available fields to refine the target audience, such as filtering subscribers by lists, tags, or other custom fields.
Once done, click Open Editor to open the automation rule editor.
Step 6: Add the Twilio action inside the loop
Click the + button to add a child action beneath the Loop action.

In the modal that appears, search for Twilio, then click Set up to configure the Send Twilio Message action.

Important:
The Twilio action must be placed inside the loop so it can access the custom fields of the subscriber currently being processed.
The action settings drawer will open, allowing you to set the message, recipient, and sender.

1. The message
Feel free to write any message content as long as it includes the [[campaign.view_in_browser_url]] merge tag. This merge tag resolves to the browser version of the generated newsletter.
For example,
For a new-post notification, you might use:
We have published a new update. Read it here: [[campaign.view_in_browser_url]]
For a daily digest:
Your daily news digest is ready: [[campaign.view_in_browser_url]]
Keep the message concise. Longer messages can be divided into multiple SMS segments and may cost more.
2. The recipient
Use the merge-tag picker to select the looped subscriber’s phone-number field.

Important:
The exact merge-tag prefix may vary because Loop actions have their own unique context. Using the merge-tag picker is safer than typing the field manually.
The selected tag will resemble:
[[loop-context.phone]]
Do not copy that example literally. Select your phone field from the merge-tag picker, so Noptin inserts the correct loop-specific tag.
3. The sender
If you are sending from a Twilio phone number, enter it in the From field:

If you use a Twilio Messaging Service such as WhatsApp, enter its SID in Messaging Service SID:

Warning:
Leave From empty when using a Messaging Service unless your Twilio configuration specifically requires otherwise.
Step 7: Review the complete automation
Your automation should resemble the one shown in the image below:

Activate the automation rule when you are ready.
Troubleshooting
If no SMS is sent, check that:
- The automation rule is enabled.
- Automated email is published.
- The generated newsletter completes successfully.
- The automation rule’s campaign Parent ID condition contains the correct automated email ID.
- There’s at least one matching subscriber.
- The subscriber’s phone field is not empty.
- The collected phone number uses E.164 format.
- Your Twilio Account SID and Auth Token are correct.
- The Twilio number can send messages to the recipient’s country.
- The Loop action contains the Twilio action as its child.
Browser-link personalization
The campaign browser URL generated in this automation identifies the generated newsletter. Because it is created outside an active email-recipient session, it should be treated as a general browser link.
The newsletter will display correctly, but the URL does not automatically include subscriber-specific email tracking, personalization, or unsubscribe context.
If you need a unique tracked URL for every SMS recipient, that would require an additional recipient-specific URL implementation.
Final result
Once everything is configured, Noptin can use the same generated content for email and SMS:
- New Post Notifications can send an SMS when their newsletter finishes.
- Daily Post Digests can send an SMS linking to the completed digest.
- Category filters remain controlled by the source email automation.
- Subscriber lists, tags, consent fields, and statuses can control who receives SMS messages.
- Twilio handles the final message delivery.
This lets subscribers open the complete newsletter in their browser without placing the full digest or post content inside an SMS.



Leave a Reply