管理员可在周报页先发一封测试邮件验证邮箱配置;测试不写入发送记录、不改变确认状态,也不会把该周标记为已发送。
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user