carry: carryNotices setting keeps notices on-site only in the test area
This commit is contained in:
@@ -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, '&').replace(/</g, '<').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);
|
||||
|
||||
Reference in New Issue
Block a user