Skip to content

Commit ac65e7e

Browse files
os-billclaude
andauthored
docs(configure): the notification template locale is the notification's, not the recipient's (#255)
The Notification Templates field table told an admin that a template's `locale` is "matched to the recipient". The delivery path never reads a recipient locale: `messaging-service.ts` contains zero occurrences of `locale` (control- probed against 41/14/14 in the sibling channel files), and `recipient- resolver.ts` — the file whose whole job is resolving recipients — has zero as well. Both template channels resolve it identically, byte for byte: `email-channel.ts:224` and `sms-channel.ts:124` are `const locale = typeof payload.locale === 'string' ? payload.locale : defaultLocale;`, and the inbox notify-template path takes `payload.locale` else `getDefaultTemplateLocale()` (`inbox-channel.ts:143-145`), which reads `i18n.getDefaultLocale()`. So the locale is the notification's own, and one emit renders in a single locale for everyone it fans out to. The page was inviting an admin to author `es` and `en` rows expecting two recipients to read in their own languages, which cannot pay off. Corrected the field-table cell and stated the consequence next to the table, aligned to upstream's own phrasing at `messaging-service-plugin.ts:250` ("one locale per notification: payload.locale, else the deployment default") rather than coining a third wording. Reports the wiring as it stands; makes no forecast about recipient-locale matching. Claude-Session: https://claude.ai/code/session_01ChPQM8jamxLUfUAxwFpJ8S Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1034f5f commit ac65e7e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎content/docs/configure/notifications.mdx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,20 @@ those channels send. The in-app inbox does not read these rows — see
166166
|---|---|
167167
| `topic` | Topic this template renders |
168168
| `channel` | Channel the rendered output targets |
169-
| `locale` | Locale of this rendering (matched to the recipient) |
169+
| `locale` | Locale of this rendering — the notification's own, not the recipient's |
170170
| `version` | Template version number |
171171
| `subject` | Rendered title |
172172
| `body` | Message body (markdown) |
173173
| `format` | Output format for the body |
174174
| `is_active` | Boolean — whether this template is used for rendering |
175175

176+
The locale is matched on the **notification**, not the recipient: a delivery
177+
renders with `payload.locale` when the producer sets one, else the deployment
178+
default. Nothing resolves a locale from the person receiving it, so one emit
179+
renders in a single locale for every recipient it reaches — authoring `es` and
180+
`en` rows for a topic gives the producer two renderings to choose between, not
181+
two recipients reading in their own language.
182+
176183
These objects are **system-managed**: rows are seeded by the platform and the
177184
capabilities you run, so most of your work is editing template content or
178185
toggling `is_active`, `enabled`, and preference defaults rather than creating

0 commit comments

Comments
 (0)