Repository navigation
feat(email): 接入 Resend 事务邮件发信服务(OTP 用) - #50
Merged
Merged
Conversation
ResendEmailService:后端直连 Resend REST API(send-only key)发 HTML 邮件。 不走 MCP(agent 交互用)、不自建 SMTP(Oracle 封出站 25,见 AGENTS.md)。 发信失败只记日志返回 false,由调用方决定是否阻断。 - resend.api-key / resend.from 走 env(RESEND_API_KEY / RESEND_FROM) - 域名验证前默认从 onboarding@resend.dev 发;验证 involutionhell.com 后 把 resend.from 换成 noreply@involutionhell.com - 3 测试(payload 构造 / 未配置不发 / 配置判定);真实发信已 curl 冒烟通过 后续 OTP 子系统(待注册态 + 验证码 + callback 集成 + 前端两步)调这个 service。
- sendHtml 路由到 buildPayload,生产发信与被测路径统一(不再两份重复实现) - 失败日志去掉收件邮箱与 Resend 响应体(响应体常回显 PII) - InterruptedException 单独 catch 并恢复线程中断标志,不再吞掉 - 配了 key 却仍用沙箱 from(onboarding@resend.dev)时启动告警——避免"key 有效 但给真实用户发信被拒"的隐性陷阱;application.properties 注释写明前置步骤
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.
OTP 子系统的发信基础。后端直连 Resend REST API 发事务邮件。
为什么这样接
mcp.resend.com是给 agent 交互用的;生产后端运行时应调 REST API(同一个 key)。改动
ResendEmailService.sendHtml(to, subject, html):HTTPS POST 到api.resend.com/emails,失败记日志返回 false(不抛,OTP 调用方按可重试用户错误处理)。resend.api-key/resend.from走 env。域名验证前默认onboarding@resend.dev。验证
待办(发给真实用户的前置)
需在 Resend dashboard 验证
involutionhell.com发信域名(加 Cloudflare DKIM 记录),之后把RESEND_FROM换成noreply@involutionhell.com。验证前只能发给账号本人。🤖 Generated with Claude Code
https://claude.ai/code/session_01RtSNVtrEkCsFVHrbt4Zjgi