Daily post-purchase review request emails for Shopify

Every morning, email customers who got their Shopify order seven days ago and ask for a review, with safe retries and a quiet list for opted-out shoppers.

Deterministic Code
ShopifyResendMarketingOperationsEmail Automation

Build a deterministic code workflow that runs a daily post-purchase review request email blast for my Shopify store, sent through Resend.

Trigger: cron, every day at 10:00 in my store's local time zone.

Step 1 — pull the eligible orders from Shopify. Call Shopify's List Orders with filters financial_status=paid and fulfillment_status=fulfilled, and a 24-hour window on updated_at that lands exactly seven days ago (use the configured lookback window, default 7 days, from now in the store time zone). Paginate via the Link header until all matching orders are pulled (max 250 per page).

Step 2 — filter the orders before sending. Drop any order whose customer carries one of the excluded customer tags (default: no-marketing) — read the comma-separated tags string on the customer object. Also drop any order that has been refunded since fulfillment (any refund with a created_at after the fulfillment's created_at, or financial_status of refunded / partially_refunded covering the line items).

Step 3 — build the email payload. For each remaining order, build one entry: to = customer email, from = the configured verified Resend sender, subject = the configured subject template, html = the configured HTML body template. Interpolate {{first_name}} from customer.first_name, {{order_number}} from order.name (or order.order_number), {{product_title}} from the first line item's title, and {{product_image}} from the first line item's product image URL (look up via the product's images if not on the line item directly). Skip orders with no customer email.

Step 4 — send via Resend's Send Batch Emails endpoint. Batch in groups of up to 100 entries per call and paginate calls as needed. On every batch send, set an Idempotency-Key header derived from the Shopify order IDs in that batch (for example, a stable hash of the sorted order ID list, or one batch per order with key = `review-request-{order_id}` if you want per-order idempotency) so a retry never double-sends. Respect Resend's 2 req/sec send limit and back off on 429 using the retry-after header.

Step 5 — log a summary at the end: how many orders matched, how many were filtered out and why (opted-out tag, refunded), how many emails were attempted, how many Resend accepted, and any errors with the failing order ID.

Expose these as workflow inputs so the operator can edit them without touching code: lookback_days (default 7), resend_from (verified-domain From address, e.g. "Acme Reviews <reviews@acme.com>"), subject_template (default "How are you liking your {{product_title}}?"), html_body_template (default a simple branded HTML body that greets {{first_name}}, references order {{order_number}}, embeds {{product_image}}, and includes a call-to-action link), and excluded_customer_tags (default ["no-marketing"]). The HTML body template should be editable as a single string.

Authentication: use the existing Shopify connection (shop domain + admin access token) and the existing Resend connection (API key). Do not invent new credentials. Keep the flow deterministic — no LLM steps. Use Shopify REST Admin API version 2026-01.

Additional information

What does this prompt do?
  • Runs every morning at 10am in your store's time zone and looks for Shopify orders that were paid and shipped exactly seven days ago.
  • Sends each of those customers a personalized review request email through Resend, with their first name, order number, and a photo of what they bought.
  • Skips customers you have tagged as opted out, and skips orders that were refunded after shipping so you never ask for a review on a returned item.
  • Builds in a safe retry guard so the same customer is never emailed twice if the job runs more than once.
What do I need to use this?
  • A Shopify store with admin access so you can connect orders, customers, and products.
  • A Resend account with at least one verified sending domain.
  • The customer tag you use to mark people who do not want marketing emails, for example no-marketing.
How can I customize it?
  • Change the waiting window if seven days is too soon or too late for your category. Furniture brands often pick fourteen or twenty one days.
  • Edit the subject line and email body to match your brand voice, and swap in the review link or platform you use.
  • Add more exclusion tags, like wholesale or VIP, so certain customer groups never get the review ask.
  • Change the send time so the email goes out when your customers are most likely to open it.

Frequently asked questions

Will the same customer ever get two review request emails for the same order?
No. Each send is tagged with the order ID, so if the job runs twice or retries after a hiccup, the duplicate send is dropped and only one email goes out per order.
What happens if a customer returned the item?
Orders that were refunded after shipping are filtered out before the email goes out, so you never ask for a review on something the customer sent back.
How do I stop emailing certain customers?
Tag them in Shopify with the opt-out tag you configure, for example no-marketing. The workflow checks each customer's tags and skips anyone on that list before sending.
Do I need a verified domain in Resend?
Yes. Resend will only send emails to your real customers from a domain you have verified in their dashboard. Add your domain and the DNS records once, and you are good to go.
Can I send from a different platform instead of Resend?
This prompt is wired for Resend, but the workflow author can swap in another email provider you already use. Just say so when you open the prompt.

Stop chasing review requests by hand.

Connect Shopify and Resend once, and this runs every morning to ask the right customers for a review at the right moment.