Skip to content

feat(brain): Resend email integration with pixel tracking#296

Merged
ruvnet merged 6 commits intomainfrom
feat/resend-email-brain-integration
Mar 25, 2026
Merged

feat(brain): Resend email integration with pixel tracking#296
ruvnet merged 6 commits intomainfrom
feat/resend-email-brain-integration

Conversation

@ruvnet
Copy link
Owner

@ruvnet ruvnet commented Mar 24, 2026

Summary

  • Add Resend.com email integration for pi.ruv.io brain (pi@ruv.io sender)
  • New src/notify.rs module: rate-limited notifications, styled HTML templates, open tracking pixel, unsubscribe links
  • 8 new /v1/notify/* routes: test, status, send, welcome, help, digest, pixel, opens
  • Cloud Scheduler brain-daily-digest job at 8 AM PT for autonomous discovery emails
  • ADR-125 documents architecture, secrets audit, and deployment status

Changes

  • crates/mcp-brain-server/src/notify.rs — new Resend HTTP client (500 lines)
  • crates/mcp-brain-server/src/routes.rs — 8 handlers + tracking pixel endpoint
  • crates/mcp-brain-server/src/types.rsnotifier field on AppState
  • crates/mcp-brain-server/src/lib.rs — module registration
  • docs/adr/ADR-125-resend-email-brain-integration.md — full ADR

Infrastructure Already Deployed

  • RESEND_API_KEY secret mounted on Cloud Run
  • brain-daily-digest scheduler job active
  • 4 test emails verified delivered

Test plan

  • cargo check -p mcp-brain-server passes
  • Release build succeeds
  • Deploy to Cloud Run and verify /v1/notify/test returns 200
  • Verify tracking pixel at /v1/notify/pixel/:id returns 1x1 GIF
  • Verify /v1/notify/opens returns open rate stats
  • Confirm daily digest scheduler fires correctly

🤖 Generated with claude-flow

ruvnet added 6 commits March 24, 2026 22:37
Wire pi@ruv.io as the brain's email identity via Resend.com for
notifications, discovery digests, and conversational interaction.

- Add src/notify.rs: Resend HTTP client with 11 rate-limited categories,
  styled HTML templates, open tracking pixel, and unsubscribe links
- Add 8 new routes: test, status, send, welcome, help, digest, pixel, opens
- All /v1/notify/* endpoints gated by BRAIN_SYSTEM_KEY auth
- Cloud Scheduler job brain-daily-digest at 8 AM PT for discovery emails
- RESEND_API_KEY secret mounted on Cloud Run (ruvbrain-00133-r2t)
- 4 test emails verified delivered to ruv@ruv.net

Co-Authored-By: claude-flow <ruv@ruv.net>
- Add Email tab to Encyclopedia Galactica modal with subscribe form
- Add email subscription CTA in "Ready to connect" section
- Add Subscribe link in footer navigation
- Add POST /v1/notify/subscribe (public) — sends welcome email
- Add POST /v1/notify/unsubscribe (public) — handles opt-out
- Mark inbound email commands as "coming soon" (Resend webhooks TBD)
- Add subscribeEmail() JS with fallback to mailto

Co-Authored-By: claude-flow <ruv@ruv.net>
- Add POST /v1/email/inbound webhook handler for Resend inbound emails
- Parse email subjects for commands: search, status, help, drift, etc
- Semantic search via email: reply with "search <query>" to get results
- Remove "coming soon" label from email commands on website
- MX record updated: ruv.io -> inbound-smtp.resend.com (priority 10)
- Webhook registered: pi.ruv.io/v1/email/inbound (ID: 55c6592c)
- Old GoDaddy MX records removed from Cloudflare

Co-Authored-By: claude-flow <ruv@ruv.net>
- Add POST /v1/chat/google endpoint for Google Chat webhook
- Handle ADDED_TO_SPACE (welcome), MESSAGE (commands), REMOVED_FROM_SPACE
- Commands: search, status, drift, recent, help + free-text auto-search
- Rich Cards V2 responses with header, key-value widgets, and links
- Service account pi-brain-chat created with Cloud Run invoker role
- ADR-126 documents architecture, marketplace config, deployment steps

Co-Authored-By: claude-flow <ruv@ruv.net>
- Add 'text' field to all Chat card responses (required for HTTP endpoint mode)
- Parse Chat events from raw bytes for resilience against unknown fields
- Log raw payload on parse failure for debugging
- Return helpful fallback text on malformed events

Co-Authored-By: claude-flow <ruv@ruv.net>
…c reasoning

Add autonomous Gist publishing for novel discoveries with novelty gates,
enhanced cognitive tick loop (60s lightweight + 5min full cycle), expanded
symbolic reasoning with cross-domain inference, and dashboard UI improvements.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit cd96526 into main Mar 25, 2026
6 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