Add direct payment links and Addie email response capability#507
Merged
Conversation
- Add `send_payment_request` Addie tool that: - Finds or creates prospects by name/domain - Shows contacts and registered users - Generates Stripe payment links - Sends invoices with billing address - Suggests membership tier based on company size - Add Quick Action Bar to admin prospects page: - Type-to-search for companies - One-click payment link or invoice generation - Create new prospect if not found - Pre-fills forms with contact info 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add couponId and promotionCode parameters to createCheckoutSession - Pre-apply discounts to Stripe checkout sessions - Add discount_percent, discount_amount_dollars, discount_reason parameters to send_payment_request Addie tool - Auto-apply existing org discounts when generating payment links - Create new discounts on-the-fly when requested Now Addie can handle requests like: - "Give Acme a 20% discount and send them a payment link" - "Send a discounted link to the startup" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When Addie is CC'd on prospect emails and explicitly invoked (e.g., "Addie, send a payment link"), she can now process the request and reply in the email thread. Changes: - Add email-handler.ts for detecting Addie invocations and processing requests - Add sendEmailReply to notifications/email.ts with proper threading headers - Add 'email' event type to AddieInteractionLog for audit logging - Wire up email handler in bolt-app.ts initialization - Pass workosUserId (not contactId) for proper admin authorization - Sanitize email metadata in prompts to prevent injection - Validate fromEmail domain to prevent spoofing - Fix recipient filtering to use domain-based exclusion Security improvements based on code review: - Sanitize email From/Subject before including in Claude prompt - Validate fromEmail is from agenticadvertising.org domain - Use domain-based pattern for excluding our addresses from recipients 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolve merge conflict in admin-tools.ts by keeping both: - Payment link/invoice imports (from this branch) - Organization merge imports (from main) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <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.
Summary
This PR adds two related features for streamlining prospect-to-member conversion:
1. Direct Payment Links (Admin UI + Addie)
send_payment_requestAddie tool for generating payment links or invoices with optional discounts2. Addie Email Response Capability
addie+prospect@agenticadvertising.org), Addie can now respondSecurity Improvements
Files Changed
server/src/addie/email-handler.ts- New: Email invocation detection and processingserver/src/addie/mcp/admin-tools.ts- Addedsend_payment_requesttoolserver/src/notifications/email.ts- AddedsendEmailReplyfunctionserver/src/routes/webhooks.ts- Wire up email handler, include workosUserId in contactsserver/src/addie/types.ts- Added 'email' event type to interaction logserver/src/billing/stripe-client.ts- Added discount support to checkout sessionsserver/public/admin-prospects.html- Quick Action Bar UITest plan
addie+prospect@agenticadvertising.orgwith Addie invocation🤖 Generated with Claude Code