Add a test notice button to Site settings
Panel → Site settings → Notices → Send a test notice emails the addresses in the box now and shows where it came from, or Google's reason for refusing, so the Gmail setup can be checked without the journal. Superadmins only (POST /api/admin/panel/test-notice). The docs now say the sender must be a Workspace user: a group can't be acted as through delegation, though it can receive notices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c63478a72a
commit
8fd3a9b15b
5 changed files with 148 additions and 9 deletions
|
|
@ -13,11 +13,15 @@ import { siteFor } from "./pageMeta.js";
|
|||
|
||||
const EMAIL = /^[^\s@,;<>]+@[^\s@,;<>]+\.[^\s@,;<>]+$/;
|
||||
|
||||
export function recipients(db) {
|
||||
const row = db.prepare(`SELECT notify_emails FROM site_settings WHERE id = 'site'`).get();
|
||||
return String(row?.notify_emails ?? "")
|
||||
/* The usable addresses in a list separated by commas, semicolons or
|
||||
spaces; anything else is left out. */
|
||||
export const addresses = (text) =>
|
||||
String(text ?? "")
|
||||
.split(/[\s,;]+/)
|
||||
.filter((address) => EMAIL.test(address));
|
||||
|
||||
export function recipients(db) {
|
||||
return addresses(db.prepare(`SELECT notify_emails FROM site_settings WHERE id = 'site'`).get()?.notify_emails);
|
||||
}
|
||||
|
||||
/* queue: the admin path of the queue it landed in, eg. /admin/requests */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue