Templates separate form from data
A template holds the message structure with placeholders, and the service fills it with data at send time. This keeps copy editable without code changes and consistent across sends.
Per channel variants
The same notification needs different shapes per channel: a short push, a richer email, a plain SMS. Templates are usually keyed by notification type and channel.
Localization
- Each template has variants per locale, chosen from the user language preference.
- Pluralization and date and number formats follow locale rules.
- A fallback locale covers missing translations.
Safety
Rendering must escape user supplied values to avoid injection in email html, and missing variables should fail loudly rather than ship a broken message.
Key idea
Templates merge data with per channel localized variants so each user gets a correctly formatted message in their language.