domma-cms 1.76.0 → 1.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/admin/js/lib/shortcode-registry.js +1 -1
- package/admin/js/lib/site-settings-arrange.js +3 -3
- package/admin/js/templates/docs/usage-shortcodes-content.html +3 -2
- package/admin/js/templates/settings.html +26 -0
- package/admin/js/views/settings.js +3 -3
- package/docs/DommaFeatures.md +2 -2
- package/docs/markdown-shortcodes.md +18 -3
- package/docs/screenshots/email-branding-gallery.png +0 -0
- package/docs/screenshots/email-branding-waypoint.png +0 -0
- package/package.json +1 -1
- package/plugins/_lib/admin/mail/body-menu.js +1 -1
- package/plugins/_lib/admin/mail/cms-host.js +1 -1
- package/plugins/_lib/admin/mail/compose-window.js +1 -1
- package/plugins/_lib/admin/mail/contacts.js +1 -1
- package/plugins/_lib/admin/mail/diagnostics-section.js +1 -1
- package/plugins/_lib/admin/mail/drag-drop.js +1 -1
- package/plugins/_lib/admin/mail/folder-tree.js +1 -1
- package/plugins/_lib/admin/mail/font-controls.js +1 -1
- package/plugins/_lib/admin/mail/fonts.js +1 -1
- package/plugins/_lib/admin/mail/host-context.js +1 -1
- package/plugins/_lib/admin/mail/identity.js +1 -1
- package/plugins/_lib/admin/mail/image-senders-section.js +1 -1
- package/plugins/_lib/admin/mail/keyboard.js +1 -1
- package/plugins/_lib/admin/mail/mail.html +1 -1
- package/plugins/_lib/admin/mail/message-actions.js +1 -1
- package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
- package/plugins/_lib/admin/mail/panes.js +1 -1
- package/plugins/_lib/admin/mail/reader-kit.js +1 -1
- package/plugins/_lib/admin/mail/reader-runtime.js +1 -1
- package/plugins/_lib/admin/mail/reader-view.js +1 -1
- package/plugins/_lib/admin/mail/resizable.js +1 -1
- package/plugins/_lib/admin/mail/restore-spam.js +1 -1
- package/plugins/_lib/admin/mail/rules.js +1 -1
- package/plugins/_lib/admin/mail/scheduling.js +1 -1
- package/plugins/_lib/admin/mail/section-kit.js +1 -1
- package/plugins/_lib/admin/mail/security-note.js +1 -1
- package/plugins/_lib/admin/mail/settings-section.js +1 -1
- package/plugins/_lib/admin/mail/templates.js +1 -1
- package/plugins/_lib/admin/mail/threads.js +1 -1
- package/plugins/_lib/admin/mail/vacation.js +1 -1
- package/plugins/_lib/admin/mail/when-closed.js +1 -1
- package/plugins/_lib/admin/ui/dates.js +1 -1
- package/plugins/_lib/admin/ui/resizable.js +1 -1
- package/plugins/_lib/admin/ui/rich-field.js +1 -1
- package/plugins/_lib/domma-mail.lock.json +83 -83
- package/plugins/_lib/mail/accountFileStore.js +1 -1
- package/plugins/_lib/mail/accountRepository.js +1 -1
- package/plugins/_lib/mail/accountRoutes.js +1 -1
- package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
- package/plugins/_lib/mail/bodyTokens.js +1 -1
- package/plugins/_lib/mail/compose.js +1 -1
- package/plugins/_lib/mail/defaults.js +1 -1
- package/plugins/_lib/mail/envelope.js +1 -1
- package/plugins/_lib/mail/folderActions.js +1 -1
- package/plugins/_lib/mail/folderRuntime.js +1 -1
- package/plugins/_lib/mail/folders.js +1 -1
- package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
- package/plugins/_lib/mail/mbox.js +1 -1
- package/plugins/_lib/mail/message-action.js +1 -1
- package/plugins/_lib/mail/messageSecurity.js +1 -1
- package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
- package/plugins/_lib/mail/networkAddresses.js +1 -1
- package/plugins/_lib/mail/networkPolicy.js +1 -1
- package/plugins/_lib/mail/oauthAccounts.js +1 -1
- package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
- package/plugins/_lib/mail/oauthRuntime.js +1 -1
- package/plugins/_lib/mail/pollSchedule.js +1 -1
- package/plugins/_lib/mail/poller.js +1 -1
- package/plugins/_lib/mail/pollerRuntime.js +1 -1
- package/plugins/_lib/mail/priority.js +1 -1
- package/plugins/_lib/mail/publicMailbox.js +1 -1
- package/plugins/_lib/mail/readRuntime.js +1 -1
- package/plugins/_lib/mail/render.js +1 -1
- package/plugins/_lib/mail/ruleRunner.js +1 -1
- package/plugins/_lib/mail/schedulerRuntime.js +1 -1
- package/plugins/_lib/mail/secretProvider.js +1 -1
- package/plugins/_lib/mail/secretbox.js +1 -1
- package/plugins/_lib/mail/senderAuth.js +1 -1
- package/plugins/_lib/mail/sieve.js +1 -1
- package/plugins/_lib/mail/smtpService.js +1 -1
- package/plugins/_lib/mail/snoozeRuntime.js +1 -1
- package/plugins/_lib/mail/store.js +1 -1
- package/plugins/_lib/mail/subscriptions.js +1 -1
- package/plugins/_lib/mail/syncPlan.js +1 -1
- package/plugins/_lib/mail/syncRuntime.js +1 -1
- package/plugins/_lib/mail/syncSelection.js +1 -1
- package/plugins/_lib/mail/unreadBadge.js +1 -1
- package/plugins/_lib/mail/unsubscribe.js +1 -1
- package/plugins/_lib/mail/vacationRunner.js +14 -2
- package/plugins/_lib/mail/vacationRuntime.js +23 -5
- package/plugins/_lib/mail/write.js +1 -1
- package/plugins/_lib/outreach/sending.js +3 -1
- package/plugins/_lib/public/rich-text.mjs +1 -1
- package/plugins/_lib/rich-text.js +1 -1
- package/plugins/docs/CHANGELOG.md +5 -0
- package/plugins/docs/plugin.js +2 -2
- package/plugins/free-tier.lock.json +7 -7
- package/plugins/shopping-cart/CHANGELOG.md +5 -0
- package/plugins/shopping-cart/lib/accounts.js +1 -1
- package/plugins/support/CHANGELOG.md +5 -0
- package/plugins/support/lib/mail.js +2 -2
- package/server/routes/api/settings.js +45 -8
- package/server/services/actions.js +2 -1
- package/server/services/callInvites.js +1 -1
- package/server/services/content.js +5 -0
- package/server/services/email.js +10 -4
- package/server/services/emailBrand.js +126 -0
- package/server/services/emailExamples.js +37 -0
- package/server/services/geocode.js +158 -0
- package/server/services/instantCalls.js +1 -1
- package/server/services/mapPins.js +45 -11
- package/server/services/markdown.js +13 -4
- package/server/services/passwordReset.js +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/schedulerRuntime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The worker behind "send later", "undo send" and "snooze".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/secretProvider.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {createCipheriv, createDecipheriv, createHash, randomBytes, scryptSync} from 'node:crypto';
|
|
4
4
|
import fs from 'node:fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/secretbox.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** CMS compatibility entry point. Standalone hosts create their own secret box. */
|
|
4
4
|
import path from 'node:path';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/senderAuth.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Did this message really come from the address in its From line?
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/sieve.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/** ManageSieve (RFC 5804). One bounded, TLS-verified session per operation. */
|
|
4
4
|
import net from 'node:net';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/smtpService.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Sending, and keeping a copy where the rest of your clients will find it.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/snoozeRuntime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {safeWritePool, moveMessage} from './write.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/subscriptions.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
export function resolveSubscriptions(boxes) {
|
|
4
4
|
const list = boxes ?? [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/syncRuntime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {missingUids, planFolderSync} from './syncPlan.js';
|
|
4
4
|
import {resolveSyncFolders} from './syncSelection.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/syncSelection.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Which folders a mailbox keeps mirrored.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/unreadBadge.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* The free reader's sidebar badge - unread mail in each mailbox's INBOX.
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* CMS transport adapter for the shared away responder. Away replies go out in the mailbox's
|
|
3
|
+
* Email Pro branding when Email Pro is on (its registry's `brandAway`), else plain.
|
|
4
|
+
*/
|
|
2
5
|
import {sendMessage} from './send.js';
|
|
3
6
|
import {createVacationRunner} from './vacationRuntime.js';
|
|
4
|
-
|
|
7
|
+
|
|
8
|
+
const EMAIL_PRO = Symbol.for('domma.email-pro');
|
|
9
|
+
|
|
10
|
+
export const runVacation = createVacationRunner({
|
|
11
|
+
sendMessage,
|
|
12
|
+
brand: async ({account, draft}) => {
|
|
13
|
+
const brandAway = globalThis[EMAIL_PRO]?.brandAway;
|
|
14
|
+
return typeof brandAway === 'function' ? brandAway({account, draft}) : draft;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/mail/vacationRuntime.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
import {randomUUID} from 'node:crypto';
|
|
4
4
|
import {autoReplyHeaders, isActive, normaliseVacation, replySubject, shouldAutoReply, replyHistory} from '../admin/mail/vacation.js';
|
|
5
5
|
import {textToHtml} from '../admin/mail/identity.js';
|
|
6
6
|
import {ENVELOPE_QUERY, toRecord} from './envelope.js';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Public CMS responder, with explicit transport and durable sender claims.
|
|
10
|
+
* `brand({account, draft})` may return the reply's draft in the mailbox's branding (CMS Email Pro);
|
|
11
|
+
* it can only change `html` and `body`, and a brand that fails or returns nothing sends the reply plain.
|
|
12
|
+
*/
|
|
13
|
+
export function createVacationRunner({sendMessage, isKnownSender = async () => false, brand = null}) {
|
|
14
|
+
async function present(account, draft) {
|
|
15
|
+
if (typeof brand !== 'function') return draft;
|
|
16
|
+
try {
|
|
17
|
+
const out = await brand({account, draft: {...draft}});
|
|
18
|
+
if (!out || typeof out !== 'object') return draft;
|
|
19
|
+
const html = typeof out.html === 'string' ? out.html : draft.html;
|
|
20
|
+
const body = typeof out.body === 'string' ? out.body : draft.body;
|
|
21
|
+
return {...draft, html, body};
|
|
22
|
+
} catch {
|
|
23
|
+
return draft;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
10
27
|
return async function runVacation({pool, store, account, poolKey, connection, smtp, messages, config = {}, addresses,
|
|
11
28
|
now = new Date(), budget = {remaining: 10}, folder, uidValidity, isStopping = () => false}) {
|
|
12
29
|
const report = {considered: 0, replied: 0, attempted: 0, skipped: [], errors: []};
|
|
@@ -48,11 +65,12 @@ export function createVacationRunner({sendMessage, isKnownSender = async () => f
|
|
|
48
65
|
budget.remaining--; report.attempted++;
|
|
49
66
|
try {
|
|
50
67
|
const incomingId = typeof message.messageId === 'string' && !/[\r\n]/.test(message.messageId) ? message.messageId.slice(0, 1000) : null;
|
|
51
|
-
await
|
|
68
|
+
const draft = await present(account, {
|
|
52
69
|
to: [{address: sender}], subject: replySubject(vacation, String(message.subject ?? '').slice(0, 500)),
|
|
53
70
|
body: vacation.bodyText, html: vacation.bodyHtml || textToHtml(vacation.bodyText),
|
|
54
71
|
messageId: `<${randomUUID()}@${String(smtp.from).split('@')[1]?.replace(/[^a-zA-Z0-9.-]/g, '') || 'localhost'}>`, inReplyTo: incomingId, references: incomingId ? [incomingId] : []
|
|
55
|
-
}
|
|
72
|
+
});
|
|
73
|
+
await sendMessage({smtp, account, store: null, draft, pool, poolKey, connection, allowInsecureTLS: config.allowInsecureTLS === true, headers: autoReplyHeaders(), fileCopy: false});
|
|
56
74
|
} catch (error) {
|
|
57
75
|
await store.finishAutoReply(claim, {status: error.deliveryUnknown === true || error.retryable !== true ? 'unknown' : 'failed',
|
|
58
76
|
error: 'The automatic reply could not be confirmed. Check with the sender before sending another copy.'});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {brandEmail} from '../../../server/services/emailBrand.js';
|
|
2
|
+
import {getConfig} from '../../../server/config.js';
|
|
1
3
|
/**
|
|
2
4
|
* Outreach email rendering and batch sending. Lifted from Surveys 1.4
|
|
3
5
|
* (lib/sending.js), generalised: the per-recipient link and the button label
|
|
@@ -86,7 +88,7 @@ export function renderInvite(template, contact, link, opts = {}) {
|
|
|
86
88
|
+ (footerHtml || '')
|
|
87
89
|
+ `</div>`;
|
|
88
90
|
|
|
89
|
-
return {subject, text, html};
|
|
91
|
+
return brandEmail({subject, text, html}, {site: opts.site || getConfig('site'), family: opts.family || 'campaign', preserveLayout: true});
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/public/rich-text.mjs.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Rich text in a Description field - the pure part, shared by the server, the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source: @domma-mail/core 0.
|
|
1
|
+
// Source: @domma-mail/core 0.35.0, packages/core/src/rich-text.js.
|
|
2
2
|
// Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
|
|
3
3
|
/**
|
|
4
4
|
* Rich text Description fields - cleaning what is saved and what is shown.
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
- Automated emails use the site's shared email identity, with existing message content, links, attachments and preferences preserved. Requires the coordinated CMS email-branding release.
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
## [2.15.0] - 2026-11-10
|
|
4
9
|
- **Own documents only** - a new permission, **Docs: own documents only** (`docs-restricted`), for roles that should write their own documents and nothing more: their own and shared documents only, whatever the site's "Who sees documents" setting says; no list of people and no sharing with anyone new; no public links; no emailing; nothing through other tools. Only Docs administrators see them in the list of people or can share with them. Enforced by the server on every route, and the screens hide what they cannot use. Nobody holds it unless a role is given it, so nothing changes on a site that does not use it. The Job Board gives it to companies and agents.
|
|
5
10
|
- For add-ons: `services.restrictedUser(user)`, and documents and settings answer `restrictedUser: true` for such a person.
|
package/plugins/docs/plugin.js
CHANGED
|
@@ -901,7 +901,7 @@ export default async function docsPlugin(fastify, options) {
|
|
|
901
901
|
+ (message ? `<blockquote style="border-left:3px solid #ccc;margin:0;padding:.25em 1em">${escapeHtml(message).replace(/\n/g, '<br>')}</blockquote>` : '')
|
|
902
902
|
+ (base ? `<p><a href="${escapeHtml(link)}">Open it in Docs</a></p>` : `<p>Open it in Docs on the site, at <code>${escapeHtml(where)}</code>.</p>`);
|
|
903
903
|
try {
|
|
904
|
-
await mailer.sendEmail(transport, {from: smtp.fromAddress, fromName: smtp.fromName, to: u.email,
|
|
904
|
+
await mailer.sendEmail(transport, {branding: {family: 'docs'}, from: smtp.fromAddress, fromName: smtp.fromName, to: u.email,
|
|
905
905
|
subject: `${who} shared "${doc.title}" with you`, html,
|
|
906
906
|
text: `${who} shared a document with you: ${doc.title}\n${message ? `\n${message}\n` : ''}\n${link}`});
|
|
907
907
|
n++;
|
|
@@ -999,7 +999,7 @@ export default async function docsPlugin(fastify, options) {
|
|
|
999
999
|
const failed = [];
|
|
1000
1000
|
for (const address of to) {
|
|
1001
1001
|
try {
|
|
1002
|
-
await mailer.sendEmail(transport, {from: smtp.fromAddress, fromName: smtp.fromName, to: address,
|
|
1002
|
+
await mailer.sendEmail(transport, {branding: {family: 'docs'}, from: smtp.fromAddress, fromName: smtp.fromName, to: address,
|
|
1003
1003
|
subject: mode === 'link' ? `${who} sent you "${doc.title}"` : doc.title, html, text, ...(attachments ? {attachments} : {})});
|
|
1004
1004
|
} catch (err) {
|
|
1005
1005
|
req.log.warn({err}, '[docs] send failed');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"note": "Written by `make sync-free-tier` in dcms-marketplace. Do not edit these plugins here - edit them there and sync.",
|
|
3
|
-
"source": "dcms-marketplace@
|
|
3
|
+
"source": "dcms-marketplace@5d5eabe5",
|
|
4
4
|
"plugins": {
|
|
5
5
|
"blog": {
|
|
6
6
|
"version": "1.11.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"docs": {
|
|
84
84
|
"version": "2.15.0",
|
|
85
85
|
"files": {
|
|
86
|
-
"CHANGELOG.md": "
|
|
86
|
+
"CHANGELOG.md": "daec1dd2fca964a9f86f1d478c15148a7870188bc041c10abd41110a9f3e6c0b",
|
|
87
87
|
"CLAUDE.md": "29e27e36bdf2acb65481f2e2a77bf28ced83fd403cf9352355a752faa8b41f67",
|
|
88
88
|
"admin/css/docs.css": "89304c596f2d36492198885359fa86998f9f36be522238983e32e5d01319c759",
|
|
89
89
|
"admin/lib/api.js": "0ddd567995a79e2379b92049de3b09a8bdf1c0d798042c7fbe3937f14e3631bf",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"lib/pdf-worker.js": "c256c32520a37a6579a528f16d5965951cfb65d7984a246168c1b33fd36d72eb",
|
|
112
112
|
"lib/pdf.js": "83abc3aba0c322c50b528b8a037466a294303f55d7c30f3cd1445f811b78ae28",
|
|
113
113
|
"lib/store.js": "128c372b9b2daa1370205e5261c76e90d3966717d371aeb33b9a5cccb16fa04f",
|
|
114
|
-
"plugin.js": "
|
|
114
|
+
"plugin.js": "d2383f22f97cc52e0cfae7a39096965303d372571610d3cc57cd55f7b267977c",
|
|
115
115
|
"plugin.json": "c97fc5e37494aa0ca4e4a0a89b204bb01cbdcd5c4fe36e0e68d185e56d9ba713",
|
|
116
116
|
"plugin.public.js": "a9cd7a9211f5b0006832054a15055a3c36afa9f9b284600cdc5fce19e892c178",
|
|
117
117
|
"templates/public-doc.html": "7360cbeec5cba8a2b1b1d074730972bb4b90cfe913a799a06522b2e1a0f566d8",
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
"shopping-cart": {
|
|
244
244
|
"version": "1.8.0",
|
|
245
245
|
"files": {
|
|
246
|
-
"CHANGELOG.md": "
|
|
246
|
+
"CHANGELOG.md": "d23355840d01d07c40caf499d3c53d7bce1a3f87b538ff10d6dc88f97eb77e68",
|
|
247
247
|
"CLAUDE.md": "a80eb3fb8bacb7a98e754491de2adba3b8552bdcc9dec6ecc97714f86a4788a1",
|
|
248
248
|
"admin/css/index.css": "b3e9e0c351d88a9aab2947f12c7530c70a4254017f5c87032fe66652853eb2db",
|
|
249
249
|
"admin/lib/chart.js": "b01ce5cfac773c8df8efccab50b67d3dfa99fbead0037d817553db4a6688d4d6",
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
"config.js": "31b336560d21a802d799ed487d5c3116de898446ba3521068b10d192f4ebbb2d",
|
|
263
263
|
"docs/guide.md": "664da6180b7e2d8ed804f1a2bb3ef1bb8fdc19e61cb3abff126201d7c13cf112",
|
|
264
264
|
"inject/body.html": "fe3810d85d355b402ccc368eddc0a8641b7edf1a5d9e20b9830d05268eecae67",
|
|
265
|
-
"lib/accounts.js": "
|
|
265
|
+
"lib/accounts.js": "0940fcfd169e2c3993c8f8df3dd0786d4f57777747892ef0cee0a26c91e65169",
|
|
266
266
|
"lib/commission.js": "5b10475d98cff2aaf4c76b9950f8d698d6262e36754a8963669690a8e3e9bd52",
|
|
267
267
|
"lib/description.js": "3f7a771ee14bd94764e68a918cf26a84bf03b1fa3b56b0b3dfe5a18eee09496e",
|
|
268
268
|
"lib/extensions.js": "73d3515b52c066e3e616c425d91a7a48a6aab153e7d14ae7278b38ee32649352",
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
"support": {
|
|
315
315
|
"version": "1.3.0",
|
|
316
316
|
"files": {
|
|
317
|
-
"CHANGELOG.md": "
|
|
317
|
+
"CHANGELOG.md": "2d740413e329c7201bafdb84c02e699e67f29b6388644d26ee37d5de66ba7aee",
|
|
318
318
|
"CLAUDE.md": "fe805bbe9048c0dce37e178bef34c34149ab2c2acc03766024f0daaf9f09058a",
|
|
319
319
|
"admin/css/index.css": "2e8e5a66a30aee7da4f36f8d80564e1fdadc19558c67359ae1a01a4ee56959a9",
|
|
320
320
|
"admin/lib/ai.js": "9a82ee5922bc54b20b5d108ccc9bde8791f9dac843e49d855ff6b254f3675645",
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
"lib/assist.js": "5aea85ece5490328bca7e8de28f141b5350530b790e98d02e1e414840462292e",
|
|
334
334
|
"lib/attachments.js": "e3479c7fe9f01e6287126279bc9d514fd14f00b64af9082ac49596bc6a543c23",
|
|
335
335
|
"lib/cache.js": "70cc826b24cc5359597a5c83a990f6da43cadebf2ac34094aee42058240fb72d",
|
|
336
|
-
"lib/mail.js": "
|
|
336
|
+
"lib/mail.js": "76f879c884751dfda9a7bde0090955d6532bf247f373cfb31b04f5984d7443aa",
|
|
337
337
|
"lib/receiver.js": "7ed1ae47fab820655aa4c4ddf926b089601ea03a0bb4a5346d4b3f6736b66009",
|
|
338
338
|
"lib/sender.js": "2b308422ac60a8a2801570e06319d5972797a601640c67beee95ccab9ac64092",
|
|
339
339
|
"lib/shape.js": "d60b48410aa5582ea80451c3d831686b0e29525a958733a8bc9dfaae8eca94d2",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
- Automated emails use the site's shared email identity, with existing message content, links, attachments and preferences preserved. Requires the coordinated CMS email-branding release.
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
## [1.8.0] - 2026-11-15
|
|
4
9
|
- A product's **Description** is a rich text editor: paragraphs, bold, italics, underline, lists and links. What it
|
|
5
10
|
saves is rich text, cleaned on save and again on the product page.
|
|
@@ -49,7 +49,7 @@ async function mail({to, subject, lines, link, button}) {
|
|
|
49
49
|
if (mailer) { await mailer(msg); return true; }
|
|
50
50
|
const s = site();
|
|
51
51
|
if (!isSmtpConfigured(s.smtp || {})) return false;
|
|
52
|
-
await sendEmail(await createTransport(s.smtp), {from: s.smtp.fromAddress || s.contactEmail || 'noreply@example.com', fromName: s.smtp.fromName || s.title || 'Shop', ...msg});
|
|
52
|
+
await sendEmail(await createTransport(s.smtp), {branding: {family: 'account'}, from: s.smtp.fromAddress || s.contactEmail || 'noreply@example.com', fromName: s.smtp.fromName || s.title || 'Shop', ...msg});
|
|
53
53
|
return true;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
- Automated emails use the site's shared email identity, with existing message content, links, attachments and preferences preserved. Requires the coordinated CMS email-branding release.
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
## [1.3.0] - 2026-11-16
|
|
4
9
|
|
|
5
10
|
- On the Domma server's inbox, with AI Assist: **Summarise** above a request's conversation (kept with the request), **Suggest a reply** that fills the reply box for you to edit and send yourself, and **Summarise** on the Waiting on Domma tab, grouping those requests into themes. Only the conversation's words are sent, never site names, people's names, email addresses, phone numbers or files. Sites see no change.
|
|
@@ -43,10 +43,10 @@ export async function send(msg, {log} = {}) {
|
|
|
43
43
|
if (!isSmtpConfigured(smtp)) return false;
|
|
44
44
|
const key = JSON.stringify([smtp.host, smtp.port, smtp.user, smtp.secure]);
|
|
45
45
|
if (!transport || transportFor !== key) { transport = await createTransport(smtp); transportFor = key; }
|
|
46
|
-
await sendEmail(transport, {
|
|
46
|
+
await sendEmail(transport, {branding: {family: 'support'},
|
|
47
47
|
// `msg.from`: the support mailbox, for mail TO a customer (a reply then reaches it).
|
|
48
48
|
from: msg.from || smtp.fromAddress || 'noreply@example.com',
|
|
49
|
-
fromName: '
|
|
49
|
+
fromName: smtp.fromName || s.brand?.text || s.title || 'Support',
|
|
50
50
|
to: msg.to, subject: msg.subject, html: msg.html, text: msg.text,
|
|
51
51
|
...(msg.replyTo && {replyTo: msg.replyTo})
|
|
52
52
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {normaliseEmailBrand} from '../../services/emailBrand.js';
|
|
2
|
+
import {EMAIL_EXAMPLES, emailExample} from '../../services/emailExamples.js';
|
|
1
3
|
/**
|
|
2
4
|
* Settings API
|
|
3
5
|
* GET /api/settings - get site settings
|
|
@@ -11,7 +13,7 @@ import {faviconSource, generateFavicon} from '../../services/favicon.js';
|
|
|
11
13
|
import {saveMedia} from '../../services/content.js';
|
|
12
14
|
import {randomUUID} from 'node:crypto';
|
|
13
15
|
import {authenticate, requirePermission} from '../../middleware/auth.js';
|
|
14
|
-
import {createTransport, mailFailure, TEST_EMAIL_FAILED} from '../../services/email.js';
|
|
16
|
+
import {createTransport, fromHeader, mailFailure, TEST_EMAIL_FAILED} from '../../services/email.js';
|
|
15
17
|
import {signedOnly} from '../../services/codePolicy.js';
|
|
16
18
|
import {resolveMailHost} from '../../services/mailHost.js';
|
|
17
19
|
import fs from 'fs/promises';
|
|
@@ -26,6 +28,8 @@ import {invalidateMeasurementId, measurementIdOf, normaliseMeasurementId} from '
|
|
|
26
28
|
import {assistantProblem, normaliseAssistant} from '../../services/assistant.js';
|
|
27
29
|
import {adminAssistantProblem, normaliseAdminAssistant} from '../../services/adminAssistant.js';
|
|
28
30
|
import {normaliseCharacterSettings} from '../../../public/js/characters.mjs';
|
|
31
|
+
import {queueAllPages} from '../../services/geocode.js';
|
|
32
|
+
import {listPages} from '../../services/content.js';
|
|
29
33
|
|
|
30
34
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
31
35
|
const CUSTOM_CSS_FILE = path.resolve(__dirname, '../../../content/custom.css');
|
|
@@ -132,7 +136,7 @@ export async function settingsRoutes(fastify) {
|
|
|
132
136
|
const ALLOWED_KEYS = new Set([
|
|
133
137
|
'title', 'tagline', 'description', 'logo', 'favicon',
|
|
134
138
|
'theme', 'adminTheme', 'fontFamily', 'fontSize',
|
|
135
|
-
'smtp', 'footer', 'analytics', 'social', 'locale',
|
|
139
|
+
'smtp', 'emailBrand', 'footer', 'analytics', 'social', 'locale',
|
|
136
140
|
'layoutOptions', 'seo', 'backToTop', 'goToBottom', 'cookieConsent', 'breadcrumbs', 'autoTheme',
|
|
137
141
|
'adminBrand',
|
|
138
142
|
// The screen `#/` (Dashboard) opens - see services/adminHome.js.
|
|
@@ -151,7 +155,9 @@ export async function settingsRoutes(fastify) {
|
|
|
151
155
|
// The "Reduce motion" control (Site Settings > Reduce motion) - services/motionSettings.js.
|
|
152
156
|
'motion',
|
|
153
157
|
// What every AI answer knows about the site and the rules it keeps (services/assistant.js).
|
|
154
|
-
'assistant', 'characters', 'adminAssistant'
|
|
158
|
+
'assistant', 'characters', 'adminAssistant',
|
|
159
|
+
// [map pins] addresses looked up on save (Site Settings > General > Maps) - services/geocode.js.
|
|
160
|
+
'maps'
|
|
155
161
|
]);
|
|
156
162
|
const unknownKeys = Object.keys(data).filter(k => !ALLOWED_KEYS.has(k));
|
|
157
163
|
if (unknownKeys.length > 0) {
|
|
@@ -194,6 +200,14 @@ export async function settingsRoutes(fastify) {
|
|
|
194
200
|
if ('characters' in data && (!data.characters || typeof data.characters !== 'object' || Array.isArray(data.characters))) {
|
|
195
201
|
return reply.status(400).send({error: 'Builders and Bots: send an object.'});
|
|
196
202
|
}
|
|
203
|
+
let mapLookupsTurnedOn = false;
|
|
204
|
+
if ('maps' in data) {
|
|
205
|
+
if (!data.maps || typeof data.maps !== 'object' || Array.isArray(data.maps)) {
|
|
206
|
+
return reply.status(400).send({error: 'Maps: send {lookupAddresses}.'});
|
|
207
|
+
}
|
|
208
|
+
data.maps = {lookupAddresses: data.maps.lookupAddresses === true};
|
|
209
|
+
mapLookupsTurnedOn = data.maps.lookupAddresses && getConfig('site')?.maps?.lookupAddresses !== true;
|
|
210
|
+
}
|
|
197
211
|
if ('adminAssistant' in data) {
|
|
198
212
|
const problem = adminAssistantProblem(data.adminAssistant);
|
|
199
213
|
if (problem) return reply.status(400).send({error: `Admin assistant: ${problem}`});
|
|
@@ -245,6 +259,10 @@ export async function settingsRoutes(fastify) {
|
|
|
245
259
|
merged.motion = normaliseMotionSettings(next, merged.footer);
|
|
246
260
|
}
|
|
247
261
|
}
|
|
262
|
+
if ('emailBrand' in data) {
|
|
263
|
+
try { merged.emailBrand = normaliseEmailBrand(merged.emailBrand); }
|
|
264
|
+
catch (err) { return reply.code(400).send({error: err.message}); }
|
|
265
|
+
}
|
|
248
266
|
// Never erase smtp.pass with the empty string that the GET endpoint injects for safety
|
|
249
267
|
if (merged.smtp && merged.smtp.pass === '' && existing.smtp?.pass) {
|
|
250
268
|
merged.smtp = {...merged.smtp, pass: existing.smtp.pass};
|
|
@@ -263,11 +281,31 @@ export async function settingsRoutes(fastify) {
|
|
|
263
281
|
saveConfig('site', merged);
|
|
264
282
|
invalidateMeasurementId();
|
|
265
283
|
await cache.invalidateTags(['site']);
|
|
284
|
+
// Switched on: pages saved while it was off get their address pins now, in the background.
|
|
285
|
+
if (mapLookupsTurnedOn) {
|
|
286
|
+
listPages({render: false}).then(pages => queueAllPages(pages, {log: request.log})).catch(() => {});
|
|
287
|
+
}
|
|
266
288
|
return { success: true };
|
|
267
289
|
});
|
|
268
290
|
|
|
291
|
+
fastify.get('/settings/email-examples', canRead, async () => ({examples: EMAIL_EXAMPLES.map(({id, label}) => ({id, label}))}));
|
|
292
|
+
|
|
293
|
+
fastify.post('/settings/email-preview', canRead, async (request, reply) => {
|
|
294
|
+
const site = getConfig('site');
|
|
295
|
+
if (request.body?.emailBrand !== undefined) {
|
|
296
|
+
try { site.emailBrand = normaliseEmailBrand(request.body.emailBrand); }
|
|
297
|
+
catch (err) { return reply.code(400).send({error: err.message}); }
|
|
298
|
+
}
|
|
299
|
+
const example = emailExample(request.body?.example || 'account', site);
|
|
300
|
+
if (!example) return reply.code(400).send({error: 'Choose an email example.'});
|
|
301
|
+
return example;
|
|
302
|
+
});
|
|
303
|
+
|
|
269
304
|
fastify.post('/settings/test-email', canRead, async (request, reply) => {
|
|
270
|
-
const
|
|
305
|
+
const site = getConfig('site');
|
|
306
|
+
const smtp = site.smtp;
|
|
307
|
+
const example = request.body?.example ? emailExample(request.body.example, site) : null;
|
|
308
|
+
if (request.body?.example && !example) return reply.code(400).send({error: 'Choose an email example.'});
|
|
271
309
|
if (!smtp?.host) {
|
|
272
310
|
return reply.status(400).send({ error: 'SMTP is not configured. Save your SMTP settings first.' });
|
|
273
311
|
}
|
|
@@ -284,11 +322,10 @@ export async function settingsRoutes(fastify) {
|
|
|
284
322
|
// Do NOT build a raw nodemailer transport here; that regresses on engine sync.
|
|
285
323
|
const transporter = await createTransport(smtp);
|
|
286
324
|
await transporter.sendMail({
|
|
287
|
-
from:
|
|
325
|
+
from: fromHeader(smtp.fromName, smtp.fromAddress),
|
|
288
326
|
to,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
html: '<p>This is a test email sent from <strong>Domma CMS</strong> to verify your SMTP configuration.</p>'
|
|
327
|
+
...(example || emailExample('test', site)),
|
|
328
|
+
subject: `[TEST] ${example?.subject || 'Email branding and SMTP check'}`
|
|
292
329
|
});
|
|
293
330
|
return { success: true, message: `Test email sent to ${to}` };
|
|
294
331
|
} catch (err) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {brandEmail, escapeHtml} from './email.js';
|
|
1
2
|
/**
|
|
2
3
|
* Actions Service (Pro - requires MongoDB)
|
|
3
4
|
*
|
|
@@ -241,7 +242,7 @@ async function executeStep(step, collection, entry, context) {
|
|
|
241
242
|
to,
|
|
242
243
|
subject,
|
|
243
244
|
text: body,
|
|
244
|
-
html: `<p>${body.replace(/\n/g, '<br>')}</p>`
|
|
245
|
+
...brandEmail({subject, text: body, html: `<p>${escapeHtml(body).replace(/\n/g, '<br>')}</p>`}, {site: settings, family: 'automation'})
|
|
245
246
|
});
|
|
246
247
|
|
|
247
248
|
return { to };
|
|
@@ -162,7 +162,7 @@ export async function sendInviteEmail({to, name, hostName, title, link}, {log} =
|
|
|
162
162
|
if (!isSmtpConfigured(smtp)) return false;
|
|
163
163
|
const k = JSON.stringify([smtp.host, smtp.port, smtp.user, smtp.secure]);
|
|
164
164
|
if (!transport || transportFor !== k) { transport = await createTransport(smtp); transportFor = k; }
|
|
165
|
-
await sendEmail(transport, {from: smtp.fromAddress || 'noreply@example.com', fromName: smtp.fromName || s.title || 'Calls', ...msg});
|
|
165
|
+
await sendEmail(transport, {branding: {family: 'calendar'}, from: smtp.fromAddress || 'noreply@example.com', fromName: smtp.fromName || s.title || 'Calls', ...msg});
|
|
166
166
|
return true;
|
|
167
167
|
} catch (err) {
|
|
168
168
|
try { (log?.error || console.error).call(log || console, `[calls] Invitation to ${to} not sent: ${err?.message || err}`); } catch { /* never */ }
|
|
@@ -12,6 +12,7 @@ import {config} from '../config.js';
|
|
|
12
12
|
import {hooks} from './hooks.js';
|
|
13
13
|
import {createVersion, deleteAllVersions, renameVersionDir} from './versions.js';
|
|
14
14
|
import * as cache from './cache/index.js';
|
|
15
|
+
import {queueMapAddresses} from './geocode.js';
|
|
15
16
|
|
|
16
17
|
const CONTENT_DIR = config.content.contentDir;
|
|
17
18
|
const PAGES_DIR = path.join(CONTENT_DIR, 'pages');
|
|
@@ -334,6 +335,8 @@ export async function createPage(urlPath, frontmatter, body, {exclusive = false}
|
|
|
334
335
|
const page = await readPageFile(filePath);
|
|
335
336
|
await cache.invalidateTags([`page:${urlPath}`, 'sitemap', 'pages:list']);
|
|
336
337
|
hooks.emit('content:pageCreated', {page, urlPath});
|
|
338
|
+
// [map pins] addresses: looked up in the background, never holding up the save.
|
|
339
|
+
queueMapAddresses(page.content, urlPath).catch(() => {});
|
|
337
340
|
return page;
|
|
338
341
|
}
|
|
339
342
|
|
|
@@ -392,6 +395,8 @@ export async function updatePage(urlPath, frontmatter, body, {author} = {}) {
|
|
|
392
395
|
const page = await readPageFile(filePath);
|
|
393
396
|
await cache.invalidateTags([`page:${urlPath}`, 'sitemap', 'pages:list']);
|
|
394
397
|
hooks.emit('content:pageUpdated', {page, urlPath});
|
|
398
|
+
// [map pins] addresses: looked up in the background, never holding up the save.
|
|
399
|
+
queueMapAddresses(page.content, urlPath).catch(() => {});
|
|
395
400
|
return page;
|
|
396
401
|
}
|
|
397
402
|
|
package/server/services/email.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {getConfig} from '../config.js';
|
|
2
|
+
import {brandEmail} from './emailBrand.js';
|
|
3
|
+
export {brandEmail} from './emailBrand.js';
|
|
1
4
|
/**
|
|
2
5
|
* Core Email Utility
|
|
3
6
|
* Nodemailer transport factory and generic form email sending utility.
|
|
@@ -250,6 +253,8 @@ export function fromHeader(name, address) {
|
|
|
250
253
|
/**
|
|
251
254
|
* Send a generic transactional email.
|
|
252
255
|
*
|
|
256
|
+
* `branding` explicitly opts an automated sender into the shared site presentation.
|
|
257
|
+
* With no branding option, user-composed mail passes through unchanged.
|
|
253
258
|
* `replyTo`, `headers` and `attachments` are passed to nodemailer only when
|
|
254
259
|
* given - an inline image is an attachment with a `cid` the html refers to
|
|
255
260
|
* as `<img src="cid:...">`.
|
|
@@ -259,14 +264,15 @@ export function fromHeader(name, address) {
|
|
|
259
264
|
* @returns {Promise<void>}
|
|
260
265
|
* @throws {Error} If sending the email fails.
|
|
261
266
|
*/
|
|
262
|
-
export async function sendEmail(transport, {from, fromName, to, subject, html, text, replyTo, headers, attachments}) {
|
|
267
|
+
export async function sendEmail(transport, {from, fromName, to, subject, html, text, replyTo, headers, attachments, branding}) {
|
|
263
268
|
try {
|
|
269
|
+
const presentation = branding ? brandEmail({subject, html, text}, {site: getConfig('site'), ...branding}) : {html, text};
|
|
264
270
|
const message = {
|
|
265
271
|
from: fromHeader(fromName, from),
|
|
266
272
|
to,
|
|
267
273
|
subject,
|
|
268
|
-
text,
|
|
269
|
-
html
|
|
274
|
+
text: presentation.text,
|
|
275
|
+
html: presentation.html
|
|
270
276
|
};
|
|
271
277
|
if (replyTo) message.replyTo = replyTo;
|
|
272
278
|
if (headers && Object.keys(headers).length) message.headers = headers;
|
|
@@ -354,7 +360,7 @@ export async function sendFormEmail(transport, { from, fromName, to, subject, fo
|
|
|
354
360
|
to,
|
|
355
361
|
subject,
|
|
356
362
|
text,
|
|
357
|
-
html
|
|
363
|
+
...brandEmail({subject, html, text}, {site: getConfig('site'), family: 'forms'})
|
|
358
364
|
});
|
|
359
365
|
recordSendResult(true, info.messageId);
|
|
360
366
|
|