Add post-purchase confirmation emails for checkouts and Ultra#401
Merged
Conversation
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>
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.
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
TransactionalNotification(always delivered, bypassing email-preference suppression) and deliver on themail+databasechannels as queued notifications, matching existing conventions (LicenseKeyGenerated,PluginSaleCompleted).HandleInvoicePaidJob:PurchaseReceiptis sent to the buyer inprocessCartPurchase()(current cart flow) and the legacyhandleManualInvoice()path.UltraSubscriptionStartedis sent from a newnotifyUltraSubscriber()helper invoked inhandleSubscriptionCreated(). 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:UltraSubscriptionStartedPurchaseReceiptto the buyerAll tests in the file pass, along with the related payout/pricing suites.
Note
"Ultra" is internally the
Maxplan tier, so detection keys off thesubscriptions.plans.max.*price ids. Comped Ultra subscriptions (which use the Max comped price) will also receive the welcome email.🤖 Generated with Claude Code