Newsletter signup banner, modal and branded Mailcoach pages - #490
Merged
Conversation
The site banner slot now carries a 10% off offer for joining the newsletter, and clicking it opens a signup modal instead of navigating away. The footer newsletter card opens the same modal rather than linking off-site. The modal posts straight to the Mailcoach list with the `pet` honeypot submitted empty, and sends Mailcoach back to four of our own pages so the whole signup flow stays on-brand: - /newsletter/confirm - /newsletter/subscribed - /newsletter/already-subscribed - /newsletter/unsubscribed Those URLs still need pasting into the list's redirect settings in Mailcoach — the subscribed and unsubscribed hops are driven from links inside emails, so only the list settings can point them here. The SuperNative banner it replaces stays in the repo alongside the other retired banners; its test now covers the component in isolation and asserts it is no longer mounted, mirroring TheVibesBannerTest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're not getting enough newsletter signups. This turns the site banner into a 10% off offer for subscribing, and keeps the whole signup flow on nativephp.com instead of handing people off to Mailcoach's default pages.
What changed
Banner —
x-newsletter-bannertakes the site banner slot: "Celebrate SuperNative! Join the newsletter. Get 10% off everything". Clicking it opens the signup modal rather than navigating away.Modal —
x-newsletter-modalis mounted once in the layout and opened from anywhere by dispatching anopen-newsletter-modalwindow event, so the banner, the footer card and the unsubscribed page all trigger the same thing. It posts straight to the Mailcoach list with thepethoneypot submitted empty, and carriesredirect_after_subscription_pending/_subscribed/_already_subscribedpointing at our own pages.Footer card — now a button opening the same modal instead of linking off-site to
/newsletter, with copy leading on the discount code.Four branded pages, built from a shared
x-newsletter-statuscomponent and noindexed, since they're flow endpoints rather than content:/newsletter/confirm/newsletter/subscribed/newsletter/already-subscribed/newsletter/unsubscribedConfig —
services.mailcoach.newsletter_subscribe_urlandservices.mailcoach.honeypot_field, both env-overridable, defaulting to the live list andpet.Before this ships
Those four URLs need pasting into the list's redirect settings in Mailcoach. The modal covers the immediate post-submit hop itself, but the "subscribed" and "unsubscribed" redirects fire from links inside emails, so only the list settings can drive them.
Notes
TheVibesBannerTestdid when SuperNative displaced The Vibes. No test was removed.allow_promotion_codes, so a promo code from Mailcoach will redeem — except when a per-price coupon already applies, where the code path unsets it (CartController.php:575). Discounted-price customers won't be able to stack the newsletter code.layout.blade.phpcarries two incidental Prettier normalisations (class order onfont-poppins, self-closing spacing onx-impersonate::banner) from formatting the file.Testing
11 tests in
NewsletterSignupTestcovering the banner, the modal's Mailcoach form and all four pages, plus the rewrittenSupernativeBannerTest. Also ran the 58 tests across every suite that touches the homepage, layout or footer — all green. Pint and Prettier clean.Verified the banner and modal render in a browser, and that all four pages return 200 with the right content. I also probed the Mailcoach endpoint with an empty email to confirm it accepts a token-less cross-origin POST (302, not 419) — that creates nothing and sends no mail. A real end-to-end signup hasn't been run against the production list, so the double opt-in email and code delivery are worth one live submission once the redirect URLs are saved in Mailcoach.
🤖 Generated with Claude Code