Ask for a review three days after delivery
Send a Braze review-request event three days after an order in MySQL is delivered, once per order, and skip customers who already left a review.
- MySQL
- Braze
- Any REST API
- Marketing
- once per order
The trigger
One read-only SELECT against MySQL. Rowfire polls it for new rows, and the rule fires once per order.
SELECT o.id AS order_id,
o.customer_id,
o.delivered_at,
o.delivered_at + INTERVAL 3 DAY AS review_due_at,
o.total_amount
FROM orders o
JOIN customers c ON c.id = o.customer_id
WHERE o.delivered_at IS NOT NULL
AND o.returned_at IS NULL
AND c.is_test = 0
AND NOT EXISTS (
SELECT 1 FROM reviews r WHERE r.order_id = o.id
)The best time to ask for a review is a few days after the box arrives. Nothing
in your app runs on day three, though. The order row just sits there with a
delivered_at and no review, so the ask either goes out on a fixed schedule to
everyone, or not at all.
The query turns that absence into an event. The clock is review_due_at,
three days after delivery, and the key is order_id. When a poll finds a new
row, the rule fires once per order. Orders that were returned drop out, so
do orders from test customers, and so does any order the customer already
reviewed on their own. Table and column names are a sketch; adapt them to your
schema.
MySQL reads a DATETIME as UTC. If your delivered_at stores local wall-clock
time, convert it in the query with CONVERT_TZ.
The Braze side
Bind the Braze track_event action with external_id set to
{{ customer_id }}, an event name like review_requested, and order_id and
total_amount as properties. A Braze campaign triggered by that custom event
sends the email or push, and can link straight to the review form for
{{ order_id }}.
Engineering writes the query once. Marketing owns the rule: the cadence, the action and when it goes live.
Your own review service
If reviews live in a separate service with an API, add it as an integration
and bind its call to a second rule on the same trigger, for example a POST
with {{ order_id }} and {{ customer_id }} in the body. Each rule keeps its
own count, so one can run in shadow while the other is live.
Only the orders worth asking about
A stricter filter is a trigger edit. Add o.total_amount >= 20 to skip small
orders, or a NOT EXISTS on your support tickets to hold back customers with
an open complaint. Changing the query sends the trigger’s rules back to shadow,
so you see the new numbers before anything sends.
Backtest the rule over the last few weeks to see how many asks it would have sent, then watch it in shadow before promoting it. For the same delay-plus-absence pattern on the operations side, see orders paid but not shipped in 24 hours, or for a customer-facing one, recover abandoned carts. Try a trigger on the live demo.
Questions
What if the customer reviews the order on day two?
Then a row exists in reviews, the order stops matching, and nothing fires. Only orders still without a review when review_due_at passes reach Braze.
A customer had three orders delivered this week. Do they get three asks?
With order_id as the key, yes: one per order. To ask each customer at most once a month, write a trigger keyed on customer_id and give its rule a once-per-month cadence.
Will every order delivered last year fire when I switch it on?
No. The poller starts every trigger at now, so history never fires. A backtest shows how many review requests the rule would have sent over past days, without sending any.
Does Rowfire write anything to my MySQL database?
No. The account should only have SELECT, the session runs read-only, and the query checker refuses anything but a single SELECT.