🔧 配置文件和部署文档新增 resend 邮箱服务

This commit is contained in:
mewhz
2025-09-06 15:16:02 +08:00
parent 49092780e3
commit 9e4ad29c7f
10 changed files with 30 additions and 4 deletions

View File

@@ -18,6 +18,9 @@ public class ResendEmailSender extends EmailSender {
@Value("${resend.api.key}")
private String apiKey;
@Value("${resend.from.email}")
private String fromEmail;
private final RestTemplate restTemplate = new RestTemplate();
@Override
@@ -33,7 +36,7 @@ public class ResendEmailSender extends EmailSender {
body.put("to", to);
body.put("subject", subject);
body.put("text", text);
body.put("from", "openisle <noreply@chenjiating.com>"); // todo(tim): use config
body.put("from", "openisle <" + fromEmail + ">");
HttpEntity<Map<String, String>> entity = new HttpEntity<>(body, headers);
restTemplate.exchange(url, HttpMethod.POST, entity, String.class);