Skip to content

Merge test to main#242

Merged
sweetmantech merged 1 commit intomainfrom
test
Feb 25, 2026
Merged

Merge test to main#242
sweetmantech merged 1 commit intomainfrom
test

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

Summary

🤖 Generated with Claude Code

* feat: add POST /api/notifications endpoint

REST API endpoint for sending notification emails via Resend, mirroring
the send_email MCP tool. Supports to, cc, subject, text (Markdown),
html, custom headers, and room_id for chat footer links.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* refactor: auto-resolve recipient from authenticated account

Remove 'to' param from request body. The recipient email is now
automatically resolved from the account_emails table using the
authenticated account's ID. Returns 400 if no email is found.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* refactor: extract shared processAndSendEmail for DRY

Extract room lookup, footer generation, markdown rendering, and Resend
call into lib/emails/processAndSendEmail.ts. Both the POST /api/notifications
handler and the send_email MCP tool now call the same shared function.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: use explicit === false check for discriminated union narrowing

Next.js compiler doesn't narrow !result.success on the
ProcessAndSendEmailResult union. Use result.success === false
for correct type narrowing in both MCP tool and API handler.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Feb 25, 2026 2:30pm

Request Review

@sweetmantech sweetmantech merged commit 064a133 into main Feb 25, 2026
3 checks passed
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