carry: carryNotices setting keeps notices on-site only in the test area

This commit is contained in:
martbost
2026-09-15 16:39:42 -05:00
parent 010e8d7ffc
commit 158ee291a1
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -43,7 +43,8 @@ function signer() {
// ---- notices: email + on-site inbox, sent as the company account ----
async function tell(email, subject, text) {
try { if (X.mailer && X.mailer.hasKey()) X.mailer.send(email, subject, text + '\n\nLinkSpin').catch(() => {}); } catch (e) {}
const emailOk = !(X.siteConfig && String(X.siteConfig().carryNotices || '1') === '0'); // test area: 0 = on-site notices only
try { if (emailOk && X.mailer && X.mailer.hasKey()) X.mailer.send(email, subject, text + '\n\nLinkSpin').catch(() => {}); } catch (e) {}
try {
const html = '<p>' + String(text).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/(https:\/\/[^\s]+)/g, '<a href="$1" target="_blank" rel="noopener">$1</a>').split('\n\n').join('</p><p>').replace(/\n/g, '<br>') + '</p>';
if (X.messages) await X.messages.deliver(1, X.adminEmail || 'house@linkspin.co', [email], subject, html);