Skip to content

Allow site admin to specify email messages in settings.json#138

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/allow-site-admin-specify-email-messages
Draft

Allow site admin to specify email messages in settings.json#138
Copilot wants to merge 2 commits into
mainfrom
copilot/allow-site-admin-specify-email-messages

Conversation

Copy link
Copy Markdown

Copilot AI commented May 13, 2026

All email subjects and bodies sent by this plugin were hardcoded. Admins had no way to customise copy, add branding, or translate notification messages without patching source.

Changes

  • messageUtils.js (new) — shared renderTemplate(template, vars) that expands {key} placeholders; unknown keys are left unchanged
  • update.js — reads pluginSettings.messages for footer, beginSubject, beginBody, endSubject, endBody
  • handleMessage.js — reads pluginSettings.messages for subscribeSubject, subscribeBody, unsubscribeSubject, unsubscribeBody
  • README.md — documents the messages block, all keys, defaults, and placeholder reference table

All fields are optional; omitting any key preserves the existing default. Existing deployments require no config changes.

Example

"ep_email_notifications": {
  "messages": {
    "footer": "\nManage your subscriptions at {padUrl}\n",
    "beginSubject": "[{padId}] editing started",
    "beginBody": "Your watched pad is being edited:\n  {padUrl}\n{footer}",
    "subscribeBody": "Confirm your subscription to {padId}:\n  {confirmLink}"
  }
}

Available placeholders:

Placeholder Contexts
{padId} all
{padUrl} all
{footer} beginBody, endBody
{confirmLink} subscribeBody, unsubscribeBody

Copilot AI changed the title [WIP] Add functionality for site admin to specify email messages Allow site admin to specify email messages in settings.json May 13, 2026
Copilot AI requested a review from JohnMcLear May 13, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow site admin to specify email messages in settings.json

2 participants