feat(qa): 周报邮件支持立即发送测试
build / build (push) Successful in 1m17s

管理员可在周报页先发一封测试邮件验证邮箱配置;测试不写入发送记录、不改变确认状态,也不会把该周标记为已发送。
This commit is contained in:
hermes
2026-10-26 15:31:46 +08:00
parent eed83039ab
commit 600e9a2dc2
6 changed files with 106 additions and 3 deletions
+10
View File
@@ -152,3 +152,13 @@ export async function fetchWeeklyMailSends(week: string): Promise<WeeklyMailSend
}
export const weeklyMailWeekdayLabels = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
export async function sendWeeklyMailTest(week: string): Promise<string> {
const payload = (await getPayload(endpoint('test'), undefined, {
method: 'POST',
headers,
body: JSON.stringify({ week }),
})) as { message_id: string }
if (typeof payload.message_id !== 'string' || !payload.message_id) bad()
return payload.message_id
}