Headless Email URLs for Magento 2 — Transactional Emails That Link to Your Storefront
The moment you go headless, Magento still builds every email link — order confirmations, invoices, shipment notices, password resets, newsletters — using your backend domain, not your storefront. Headless Email URLs rewrites those links to your real storefront domain …
Your headless store sends emails. Right now, the links in them point at the wrong website.
The moment you go headless, Magento keeps generating every transactional and marketing email exactly as it always has — order confirmations, invoices, shipment and credit-memo notices, password resets, welcome emails, newsletters — using its own configured base URL. On a headless build, that base URL is your backend: the admin and API host. So the “view your order” link in a customer’s confirmation points at api.yourstore.com, not the yourstore.com they actually know. It looks broken. To a nervous first-time buyer, it looks like phishing. Either way, it quietly burns the trust you paid to earn.
And the obvious fix is a trap. Repoint the shared base link URL at your storefront and you repoint the admin and the API along with it — it is one shared value. More than one team has locked itself out of its own Magento admin doing exactly that.
One setting fixes every email link — and leaves your admin alone
Headless Email URLs installs a precise, area-scoped URL rewrite. It intercepts link generation in the frontend area only — the context Magento uses when it renders an email — and substitutes your real storefront domain for the backend host. The admin, the REST and GraphQL APIs and your media URLs are never touched. Set the storefront URL once and you are done: no template overrides, no core edits, no per-email find-and-replace.
What changes
| Link before | Link after | |
|---|---|---|
| Order confirmation | api.yourstore.com/… | yourstore.com/account/orders |
| Invoice & shipment | api.yourstore.com/… | yourstore.com/account/orders |
| Password reset | api.yourstore.com/… | yourstore.com/account |
| Welcome & newsletter | api.yourstore.com/… | yourstore.com |
How it works
- Install the module and open Stores › Configuration › General › Web › Headless Storefront Links.
- Enter your storefront URL and save.
- Every link Magento renders in an email now resolves to your storefront. The admin and APIs keep using the backend host, exactly as they must.
Why it matters
Transactional emails are the highest-engagement messages you will ever send — open rates north of 60% are normal. Every one is a chance to bring a customer back to your store. Send them to a raw API domain and you waste the click, trip spam filters, and look amateur at the precise moment a buyer is deciding whether to trust you. Small, unglamorous plumbing with an outsized effect on conversion and brand trust — and on a headless store, it is not optional.
FAQ
Why can’t I just change the base URL in config?
Because Magento uses one shared base link URL for the storefront, the admin and the API. Change it for emails and you change it for the admin too — which can lock you out. Headless Email URLs scopes the rewrite to the email (frontend) area so nothing else moves.
Does it touch my API or media URLs?
No. Only link URLs generated in the frontend area are rewritten. REST, GraphQL, the admin and media/static URLs are left exactly as they are.
Does it work with any headless frontend?
Yes — Astro, Hyvä, PWA Studio or a fully custom front end. It works at the Magento layer, so it does not care what renders your storefront.
Part of the headless package
Headless Email URLs is core plumbing for the AgenticEcom Astro storefront and is included in the AgenticEcom Suite. It pairs naturally with SMTP for reliable delivery and Product Alerts, whose price-drop emails link straight back to your storefront thanks to this module.
✦ Related Products

SMTP for Magento 2 — Reliable Email Relay with OAuth2 & Logging
£99.00

Astro CORS for Magento 2 — Secure Cross-Origin GraphQL for Headless
£99.00

Astro ISR for Magento 2 — Instant Headless Cache Invalidation
£129.00

AgenticEcom Suite — The Complete Headless Magento 2 Platform
£9,995.00
AgenticEcom Astro Headless Storefront
£19,995.00
Headless Product Alerts for Magento 2 — Price-Drop Signups on Your Storefront
£129.00
