[PR #1218] [CLOSED] Add support for server templates #1541

Closed
opened 2026-05-07 01:02:35 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1218
Author: @UiP9AV6Y
Created: 11/11/2024
Status: Closed

Base: mainHead: feature_server_templates


📝 Commits (1)

  • 823070b Add support for server templates

📊 Changes

12 files changed (+599 additions, -48 deletions)

View changed files

📝 cmd/serve.go (+5 -0)
📝 docs/publish.md (+27 -0)
📝 server/config.go (+2 -0)
📝 server/errors.go (+1 -0)
📝 server/server.go (+79 -48)
📝 server/server_middleware.go (+9 -0)
server/server_templates.go (+164 -0)
server/server_templates_test.go (+178 -0)
📝 server/server_test.go (+93 -0)
📝 server/types.go (+4 -0)
📝 util/util.go (+9 -0)
📝 util/util_test.go (+28 -0)

📄 Description

instead of sending title/message templates as part of the publishing request, systems can simply reference existing templates from the server. this has two advantages
a) publish URLs become shorter
b) publish URLs become easier to reuse

the changes backwards-compatible, as the tpl parameter continues to support truthy boolean values.
the feature has to be enabled on the server. available templates and their content are exposed via new API endpoints.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/1218 **Author:** [@UiP9AV6Y](https://github.com/UiP9AV6Y) **Created:** 11/11/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature_server_templates` --- ### 📝 Commits (1) - [`823070b`](https://github.com/binwiederhier/ntfy/commit/823070bf7ee3eb520a19816a668f4b6077ad5793) Add support for server templates ### 📊 Changes **12 files changed** (+599 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `cmd/serve.go` (+5 -0) 📝 `docs/publish.md` (+27 -0) 📝 `server/config.go` (+2 -0) 📝 `server/errors.go` (+1 -0) 📝 `server/server.go` (+79 -48) 📝 `server/server_middleware.go` (+9 -0) ➕ `server/server_templates.go` (+164 -0) ➕ `server/server_templates_test.go` (+178 -0) 📝 `server/server_test.go` (+93 -0) 📝 `server/types.go` (+4 -0) 📝 `util/util.go` (+9 -0) 📝 `util/util_test.go` (+28 -0) </details> ### 📄 Description instead of sending title/message templates as part of the publishing request, systems can simply reference existing templates from the server. this has two advantages a) publish URLs become shorter b) publish URLs become easier to reuse the changes backwards-compatible, as the `tpl` parameter continues to support truthy boolean values. the feature has to be enabled on the server. available templates and their content are exposed via new API endpoints. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:02:35 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1541
No description provided.