Skip to content

Headless Email URLs

Run Magento headless and the admin and API live on one host (say magento.yourstore.com) while your customer-facing storefront lives on another (yourstore.com). But Magento still builds the links inside transactional emails — order confirmations, invoices, shipment notices, password resets — using its own Base URL. So customers receive emails that link back to your backend, not the store they know. Headless Email URLs fixes that with one setting, and without the dangerous workaround of editing Base Link URL.

The Headless Storefront Links settings in Stores → Configuration → General → Web — turn on "Use Storefront URL for Email & Link URLs" and enter your storefront URL

Install Headless Email URLs with Composer using your AgenticEcom licence key (find it on your My Licences page — one key unlocks every module you own):

Terminal window
# 1. Register the AgenticEcom repository (once per store)
composer config repositories.agenticecom composer https://repo.agenticecom.net
composer config --global --auth http-basic.repo.agenticecom.net <YOUR-LICENCE-KEY> x
# 2. Require this module
composer require agenticecom/module-headless-email-url
# 3. Apply it
php bin/magento setup:upgrade && php bin/magento setup:di:compile && php bin/magento cache:flush

Magento

Open Source 2.4.9 GA (and later 2.4.x).

PHP

Tested on 8.4 and 8.5.

Frontend

Any headless stack — Astro, Hyvä, PWA Studio, custom.

Safety

Base URLs untouched — admin, API, media and static stay on the Magento host.

The module hooks Magento’s link generation in the frontend area only — the context Magento uses when it renders an email — and swaps the backend host for your storefront URL.

SurfaceRewritten?
Transactional emails (order, invoice, shipment, credit memo, reset, welcome)✅ Point at the storefront
Newsletter / RSS links✅ Point at the storefront
XML sitemap entries✅ Point at the storefront
Admin, REST & GraphQL API URLs❌ Stay on the Magento host
Media, static & image URLs❌ Stay on the Magento host

Stores → Configuration → General → Web → Headless Storefront Links — it sits right next to Base URLs, the natural home for a setting about which URL customer links use.

  1. Set Use Storefront URL for Email & Link URLs to Yes.

  2. Enter your Headless Storefront URL — the full customer-facing URL with a trailing slash, e.g. https://yourstore.com/.

  3. Save and run php bin/magento cache:flush. Send yourself a test order email — every link now points at your storefront.

Will this change my admin or API URL?

No. It only rewrites links generated in the frontend (email) area. Your Base URLs are never modified, so the admin, REST/GraphQL APIs, media and static assets keep using the Magento host.

Why not just set the Base Link URL to my storefront?

Because Magento uses one shared Base Link URL for the storefront, the admin and the API — change it and you change all three, which can lock you out of the admin. This module avoids that entirely.

Does it work with any headless frontend?

Yes. It operates at the Magento layer, so Astro, Hyvä, PWA Studio or a fully custom storefront all benefit — they just need to serve the routes the emails link to (orders, account, and so on).

Pairs well with…

SMTP for reliable delivery, and Product Alerts — whose price-drop emails link straight back to your storefront thanks to this module.