1. Sync the data the filter needs
The segment can only filter on data Pocketflows has, so sync each member’s plan and last check-in time in theirmetadata, along with a phone number:
last_check_in_at
stays current.
2. Create the segment
Create a segment whosefilter describes the members you want, written in the
filter syntax. 30 days is 2,592,000 seconds:
id, which starts with seg_.
3. Create the trigger
Create a trigger that runs when a customer joins the segment, with the steps to run for them:project_defined_event with the event’s ID in place of
internal_event_definition. See
Send messages when something happens in your product.
The trigger sends from the business’s default phone number and email address. To choose others, pass
the ID of one in phone_number or email_address.
Steps
Steps run in order for each customer:
For example, to send a reminder email a week after the text, but only to members who still haven’t
checked in:
4. Activate the trigger
A new trigger is a draft, withstatus set to draft, and does nothing until you activate it:
status becomes active. To stop it later, call POST /triggers/:id/deactivate.
How the trigger fires
- Only new members are messaged. Customers who are already in the segment when you activate the trigger don’t receive anything. The trigger fires for customers who join afterwards.
- Time passing counts. Because the filter compares against
Date.now(), a member joins the segment on the day they pass 30 days without a check-in, even if nothing about them changed. - It isn’t instant. Pocketflows checks segment membership about every 15 minutes, so a customer is messaged up to about 25 minutes after they join.
- It can fire again. When a member checks in, they leave the segment. If they lapse again later, they rejoin and the trigger runs again.
Related
- Filter syntax for every operator and function a filter can use.
- How events and triggers work for the model behind triggers.
- Let businesses build segments from your data to let businesses build their own segments in the embed instead.