测试发送只投递到该地址,不打扰主送与抄送名单;未填时退回主送首位。
This commit is contained in:
@@ -201,6 +201,7 @@ function SettingsForm({
|
||||
const [from, setFrom] = useState(settings.from)
|
||||
const [recipients, setRecipients] = useState(settings.recipients.join('\n'))
|
||||
const [cc, setCc] = useState(settings.cc_recipients.join('\n'))
|
||||
const [review, setReview] = useState(settings.review_address)
|
||||
const [weekday, setWeekday] = useState(settings.weekday)
|
||||
const [hour, setHour] = useState(String(settings.hour))
|
||||
const [enabled, setEnabled] = useState(settings.enabled)
|
||||
@@ -220,6 +221,7 @@ function SettingsForm({
|
||||
from: from.trim(),
|
||||
recipients: splitAddresses(recipients),
|
||||
cc_recipients: splitAddresses(cc),
|
||||
review_address: review.trim(),
|
||||
weekday,
|
||||
hour: Number(hour),
|
||||
enabled,
|
||||
@@ -278,6 +280,14 @@ function SettingsForm({
|
||||
抄送(每行一个,可留空)
|
||||
<textarea rows={2} value={cc} onChange={(e) => setCc(e.target.value)} />
|
||||
</label>
|
||||
<label>
|
||||
测试/审核邮箱
|
||||
<input
|
||||
value={review}
|
||||
onChange={(e) => setReview(e.target.value)}
|
||||
placeholder="只用于发送测试,不参与正式发送"
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
发送日
|
||||
<select value={weekday} onChange={(e) => setWeekday(Number(e.target.value))}>
|
||||
|
||||
@@ -10,6 +10,7 @@ const settings = {
|
||||
from: 'kb@example.com',
|
||||
recipients: ['a@example.com'],
|
||||
cc_recipients: [],
|
||||
review_address: 'me@example.com',
|
||||
weekday: 1,
|
||||
hour: 9,
|
||||
enabled: true,
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface WeeklyMailSettings {
|
||||
from: string
|
||||
recipients: string[]
|
||||
cc_recipients: string[]
|
||||
review_address: string
|
||||
weekday: number
|
||||
hour: number
|
||||
enabled: boolean
|
||||
@@ -61,6 +62,7 @@ export function parseWeeklyMailSettings(value: unknown): WeeklyMailSettings {
|
||||
from: str(v.from),
|
||||
recipients: recipients as string[],
|
||||
cc_recipients: cc as string[],
|
||||
review_address: typeof v.review_address === 'string' ? v.review_address : '',
|
||||
weekday,
|
||||
hour,
|
||||
enabled: v.enabled,
|
||||
@@ -130,6 +132,7 @@ export async function saveWeeklyMailSettings(
|
||||
from: form.from,
|
||||
recipients: form.recipients,
|
||||
cc_recipients: form.cc_recipients,
|
||||
review_address: form.review_address,
|
||||
weekday: form.weekday,
|
||||
hour: form.hour,
|
||||
enabled: form.enabled,
|
||||
|
||||
Reference in New Issue
Block a user