Skip to content

docs: add reusable HTML email template example#5391

Open
locker95 wants to merge 2 commits into
prometheus:mainfrom
locker95:docs/email-html-template-example
Open

docs: add reusable HTML email template example#5391
locker95 wants to merge 2 commits into
prometheus:mainfrom
locker95:docs/email-html-template-example

Conversation

@locker95

Copy link
Copy Markdown

Summary

Add a complete example showing how to define an external HTML email template, load it with the top-level templates glob, and reference it from an email receiver. The example stays intentionally small while covering the configuration gap described in #1602.

cc @mxinden

Pull Request Checklist

  • Please list all open issue(s) discussed with maintainers related to this change
  • Is this a new Receiver integration?
    • I have already tried to use the Webhook Receiver Integration and 3rd party integrations before adding this new Receiver Integration
  • Is this a bugfix?
    • I have added tests that can reproduce the bug which pass with this bugfix applied
  • Is this a new feature?
    • I have added tests that test the new feature functionality
  • Does this change affect performance?
    • I have provided benchmarks comparison that shows performance is improved or is not degraded
    • I have added new benchmarks if required or requested by maintainers
  • Is this a breaking change?
    • My changes do not break the existing cluster messages
    • My changes do not break the existing api
  • I have added/updated the required documentation
  • I have signed-off my commits
  • I will follow best practices for contributing to this project

Validation

  • git diff --check
  • parsed the YAML example with Ruby/Psych
  • checked the template fields and toUpper function against the current template data model and function map
  • checked the email fields against the current configuration schema

This is a documentation-only change; no product code tests were run.

Which user-facing changes does this PR introduce?

NONE

Signed-off-by: Dean Chen <51218137+locker95@users.noreply.github.com>
@locker95
locker95 requested a review from a team as a code owner July 16, 2026 19:05
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0003e517-4bdb-436c-a264-1fa749bc78f0

📥 Commits

Reviewing files that changed from the base of the PR and between e837613 and 2e76281.

📒 Files selected for processing (1)
  • docs/notification_examples.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/notification_examples.md

📝 Walkthrough

Walkthrough

Adds documentation showing how to define a reusable HTML email template in an external file, load it through Alertmanager configuration, and reference it from an email receiver.

Changes

Email template documentation

Layer / File(s) Summary
Reusable HTML email template example
docs/notification_examples.md
Adds an external email.myorg.html template using Alertmanager data, configures the template file path, references the named template in email_configs[].html, and links to email configuration options.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the documentation example added for reusable HTML email templates.
Description check ✅ Passed The description follows the template well with summary, checklist, validation, and release-notes sections filled in.
Linked Issues check ✅ Passed The PR addresses #1602 by adding docs for defining, loading, and using a custom email template.
Out of Scope Changes check ✅ Passed The changes stay within documentation and support the stated custom email template example.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/notification_examples.md (1)

111-111: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add language identifiers to the fenced code blocks.

Use html for the template block and yaml for the Alertmanager configuration block to resolve the reported MD040 warnings.

Also applies to: 140-140

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/notification_examples.md` at line 111, Update the fenced code blocks in
the notification examples, including the template block and Alertmanager
configuration block, with the language identifiers html and yaml respectively to
resolve MD040 warnings.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/notification_examples.md`:
- Line 111: Update the fenced code blocks in the notification examples,
including the template block and Alertmanager configuration block, with the
language identifiers html and yaml respectively to resolve MD040 warnings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 86705770-9d2c-4c6d-8f0c-fbb2daef4752

📥 Commits

Reviewing files that changed from the base of the PR and between 9e50fad and e837613.

📒 Files selected for processing (1)
  • docs/notification_examples.md

Signed-off-by: Dean Chen <51218137+locker95@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No documentation on how to setup a custom email template

2 participants