${p.replace(/&/g, "&").replace(//g, ">")}
`) + .join("\n"); + for (const { email } of results) { + await sendMail(env, { to: email, subject: `${env.SITE_NAME}: the spam filter is unavailable`, text, html }); + } + } catch (err) { + console.error("could not alert the admins about the spam filter", err); + } +} + /** Posts the filter refused: hidden as spam by nobody, and not from the Tender import. */ const REFUSED = "status = 'spam' AND moderated_by IS NULL AND tender_number IS NULL"; /** - * Hide a post the filter refused, and ban the account after too many. The post - * stays restorable from /admin until the purge removes it. + * Log a post the filter refused (it was stored hidden), and ban the account + * after too many. The post stays restorable from /admin until the purge removes it. */ -export async function refusePost(env: Bindings, postId: number, userId: number, reason: string): Promise