Skip to content

Add post-purchase confirmation emails for checkouts and Ultra#401

Merged
simonhamp merged 1 commit into
mainfrom
post-purchase-emails
Jun 19, 2026
Merged

Add post-purchase confirmation emails for checkouts and Ultra#401
simonhamp merged 1 commit into
mainfrom
post-purchase-emails

Conversation

@simonhamp

Copy link
Copy Markdown
Member

What

Adds buyer-facing confirmation emails that were previously missing after a successful purchase.

  • PurchaseReceipt — sent to the buyer after any plugin / product / bundle checkout completes. Thanks them for supporting NativePHP and open source, notes that a payment receipt arrives separately from Stripe, and links them to their order history where they can access their purchases.
  • UltraSubscriptionStarted — sent when an Ultra subscription is created. Same thank-you/support framing, notes the Stripe receipt, and links to the Ultra dashboard (/dashboard/ultra).

Why

Before this change, neither plugin/product checkouts nor Ultra subscriptions sent the buyer any email — they only saw a browser success page. The only sale-related email went to the developer whose plugin sold. These add the missing customer confirmations.

How

  • Both notifications implement TransactionalNotification (always delivered, bypassing email-preference suppression) and deliver on the mail + database channels as queued notifications, matching existing conventions (LicenseKeyGenerated, PluginSaleCompleted).
  • HandleInvoicePaidJob:
    • PurchaseReceipt is sent to the buyer in processCartPurchase() (current cart flow) and the legacy handleManualInvoice() path.
    • UltraSubscriptionStarted is sent from a new notifyUltraSubscriber() helper invoked in handleSubscriptionCreated(). It resolves the plan from the invoice's plan line item and only fires for the Ultra (Max) tier; unknown price ids are caught and skipped, so Mini/Pro subscriptions send nothing.

Tests

Added three tests to HandleInvoicePaidJobTest:

  • Ultra subscription create → sends UltraSubscriptionStarted
  • Non-Ultra (Pro) subscription → sends nothing
  • Cart purchase → sends PurchaseReceipt to the buyer

All tests in the file pass, along with the related payout/pricing suites.

Note

"Ultra" is internally the Max plan tier, so detection keys off the subscriptions.plans.max.* price ids. Comped Ultra subscriptions (which use the Max comped price) will also receive the welcome email.

🤖 Generated with Claude Code

Send buyers a PurchaseReceipt after plugin/product/bundle checkouts and an
UltraSubscriptionStarted welcome when an Ultra subscription is created. Both
are transactional notifications directing users to their dashboard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review June 19, 2026 09:08
@simonhamp simonhamp merged commit 7335557 into main Jun 19, 2026
2 checks passed
@simonhamp simonhamp deleted the post-purchase-emails branch June 19, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant