A Studio Product block linked to your Shopify store can mint its own single-use discount code per recipient, scoped to that one product — no Purchase history segment or project-level Discount offer required.
MailInApp already has a project-level Discount offer for targeting a whole matched audience with one code. This is the narrower tool: a discount that lives on the Product block itself, tied to whichever real product you imported from your Shopify catalog, minted automatically for every recipient of that email, and redeemed straight back on that product's own page.
Step 1 — Connect Shopify
From Settings → Integrations, connect your Shopify store if you haven't already. MailInApp requests write_discounts alongside its read scopes specifically so it can mint the codes this use case relies on — it never asks for write access to your products, orders or customers themselves.
Step 2 — Import the product into a Product block
In the Studio, add a Product block and open its Import from store search. Pick the real item from your synced Shopify catalog rather than typing a URL by hand. Importing does three things at once: fills in name, description, image and price; switches Checkout to Link to external store checkout; and fills in External product page URL from the product's own Shopify handle. All three matter for the next step — a hand-typed URL has no real store product id behind it, so the discount toggle stays hidden until you import.
Step 3 — Turn on Per-product discount
With a real imported product on the block, a Per-product discount toggle appears in the Inspector. Turn it on and set:
- Discount type — percentage or fixed amount off.
- Discount value — the actual number.
- Expires (days after send) — how long a minted code stays valid.
This is independent of any project-level Discount offer the project might also have — a send can carry both, neither, or one without the other.
Step 4 — Send, and MailInApp mints a code scoped to just this product
Right before each recipient's email renders, MailInApp looks up their Shopify customer record by email and creates a discount code through Shopify's Admin GraphQL API: single-use (usageLimit: 1), restricted to that one customer, and restricted to just this product rather than your whole store. The block's own Buy now link is rewritten automatically to carry it — nothing to template with a merge tag by hand, since a block id isn't something you can type into a heading.
Step 5 — The shopper lands back on the exact product, code already applied
Redemption goes through your store's own /discount/<code> URL, which redirects straight to this product's own page with the code pre-applied — not your storefront's homepage and not a generic cart. That's deliberate: the email showed them one specific item, so the discounted link should land them on that same item, not make them re-find it.
Attribution works the same as any other store click
The redemption link still carries the same utm_campaign your project's other outbound links do. An order placed with the code attributes back to this send the same way any other Shopify click-through order does — see tracking Shopify orders, checkouts & revenue for how that attribution actually works end to end.
If minting fails for a recipient
Their email still sends. If no Shopify customer record matches their email, or the live API call hiccups, that recipient's Buy now just falls back to the block's plain, undiscounted product link — never a broken link, and never a blocked send.
How this differs from the project-level Discount offer
The Send page's Discount offer targets a whole matched audience — often paired with a Purchase history segment — with one code scope picked from a dropdown (store-wide or one product). This feature skips all of that: it's scoped to whatever product the block itself carries, needs no audience filter, and mints for anyone who receives the email. Each keeps its own cooldown marker too, so a per-product discount on one item never blocks another item's discount, or the project-level offer, for the same contact. See Win back past buyers with purchase-history segments & discount codes for the audience-targeted version of this pattern.
Getting started
Connect Shopify, import one real product into a Product block, turn on a modest Per-product discount, and send it to a small list first to confirm the redemption link lands where you expect. See Product block, Shopify integration, and Store-native discounts for the full reference.