mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #1057] [CLOSED] add templating for title and message fields #1504
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1504
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/binwiederhier/ntfy/pull/1057
Author: @wunter8
Created: 3/18/2024
Status: ❌ Closed
Base:
main← Head:templating📝 Commits (10+)
df7d6baadd templating for title and message fieldsb2eb5b9use existing message and title fields for templates867cf28refactor gjson parsing code03737dbupdate docs7fd5f0ballow large HTTP body so long as resulting message is small83356f5remove debug print statement1966f80Merge branch 'main' into templatingde65d07Simplify(?) templating cases9247dacMove things, revert namingc81a0f5Merge pull request #1 from binwiederhier/templating-2📊 Changes
14 files changed (+312 additions, -60 deletions)
View changed files
📝
cmd/access_test.go(+2 -0)📝
cmd/config_loader_test.go(+1 -0)📝
cmd/publish_test.go(+3 -0)📝
docs/publish.md(+28 -0)📝
docs/releases.md(+6 -0)📝
go.mod(+3 -0)📝
go.sum(+7 -22)📝
server/errors.go(+2 -0)📝
server/server.go(+66 -29)📝
server/server_admin.go(+5 -4)📝
server/server_test.go(+182 -0)📝
server/util.go(+3 -2)📝
test/server.go(+1 -1)📝
util/peek.go(+3 -2)📄 Description
Here's an initial working implementation, based on https://github.com/binwiederhier/ntfy/pull/171.
Right now, only the message and title fields can be templated, each using their own header (since this seemed like the quickest way to get something working).
In a future iteration, I think allowing other fields to be templated (e.g., priority, actions, attachment url, topic?, etc.) would be cool.
In that version, I was imagining an
X-Templateheader that includes probably a JSON string for the different fields of a message (e.g.,{"message":"${field.value} is ${field2}", "title":"An error occurred on ${hostname}", "priority":${error.level}, "attachment":"${error.screenshot.url}"})🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.