Skip to content

Commit eb078a9

Browse files
committed
change message content from field name from "content" to "message"
1 parent 4ea6fbe commit eb078a9

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ curl -X POST "https://patchwork.example.com/u/username/_/ntfy" \
323323
-d '{
324324
"type": "markdown",
325325
"title": "Alert",
326-
"content": "Something **important** happened!"
326+
"message": "Something **important** happened!"
327327
}'
328328
```
329329

assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ <h4>Notification System</h4>
313313
curl -X POST "{{.BaseURL}}/u/alice/_/ntfy" \
314314
-H "Authorization: Bearer my_token_name" \
315315
-H "Content-Type: application/json" \
316-
-d '{"type": "markdown", "title": "Alert", "content": "Something **important** happened!"}'
316+
-d '{"type": "markdown", "title": "Alert", "message": "Something **important** happened!"}'
317317

318318
# Plain text notification
319319
curl -X POST "{{.BaseURL}}/u/alice/_/ntfy" \

docs/configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,20 @@ curl -X POST "https://patchwork.example.com/u/username/_/ntfy" \
112112
-d '{
113113
"type": "markdown",
114114
"title": "Alert",
115-
"content": "Something **important** happened!"
115+
"message": "Something **important** happened!"
116116
}'
117117
```
118118

119119
#### Form POST Request
120120
```bash
121121
curl -X POST "https://patchwork.example.com/u/username/_/ntfy" \
122122
-H "Authorization: Bearer your-token" \
123-
-d "type=plain&title=Alert&content=Something happened!"
123+
-d "type=plain&title=Alert&message=Something happened!"
124124
```
125125

126126
#### GET Request with Query Parameters
127127
```bash
128-
curl "https://patchwork.example.com/u/username/_/ntfy?token=your-token&type=plain&title=Alert&content=Something%20happened!"
128+
curl "https://patchwork.example.com/u/username/_/ntfy?token=your-token&type=plain&title=Alert&message=Something%20happened!"
129129
```
130130

131131
#### Plain Text POST
@@ -146,7 +146,7 @@ curl -X POST "https://patchwork.example.com/u/username/_/ntfy" \
146146

147147
- `type` - Message type (plain, markdown, html)
148148
- `title` - Message title (optional)
149-
- `content` - Message content (required, can also use `body` or `message`)
149+
- `message` - Message content (required, can also use `body` or `message`)
150150
- `room` - Target room/channel (optional, backend-specific)
151151

152152
## Notification Backends

docs/notifications.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ curl -X POST "https://patchwork.example.com/u/yourusername/_/ntfy" \
3737
-H "Content-Type: application/json" \
3838
-d '{
3939
"title": "Script Alert",
40-
"content": "Something important happened!",
40+
"message": "Something important happened!",
4141
"type": "markdown"
4242
}'
4343
```
@@ -128,7 +128,7 @@ Requires a valid token with `POST` permission for `/_/ntfy`.
128128
{
129129
"type": "markdown",
130130
"title": "Alert Title",
131-
"content": "Message **content** here",
131+
"message": "Message **content** here",
132132
"room": "optional-room-id"
133133
}
134134
```
@@ -210,7 +210,7 @@ curl -X POST "https://patchwork.example.com/u/admin/_/ntfy" \
210210
-d '{
211211
"type": "markdown",
212212
"title": "Critical Alert",
213-
"content": "Database backup **failed**! Check logs immediately.",
213+
"message": "Database backup **failed**! Check logs immediately.",
214214
"room": "!alerts:matrix.org"
215215
}'
216216
```
@@ -226,6 +226,6 @@ curl -X POST "https://patchwork.example.com/u/admin/_/ntfy" \
226226
-d '{
227227
"type": "markdown",
228228
"title": "🚀 Deploy Success",
229-
"content": "Application deployed to **production**\nCommit: `${{ github.sha }}`"
229+
"message": "Application deployed to **production**\nCommit: `${{ github.sha }}`"
230230
}'
231231
```

internal/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ func parseNotificationFromQuery(values url.Values) (types.NotificationMessage, e
395395
msg := types.NotificationMessage{
396396
Type: values.Get("type"),
397397
Title: values.Get("title"),
398-
Content: values.Get("content"),
398+
Content: values.Get("message"),
399399
Room: values.Get("room"),
400400
}
401401

internal/types/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type MatrixConfig struct {
4242
type NotificationMessage struct {
4343
Type string `json:"type"` // "plain", "markdown", "html"
4444
Title string `json:"title"` // Message title
45-
Content string `json:"content"` // Message content
45+
Message string `json:"message"` // Message content
4646
Room string `json:"room,omitempty"` // Optional room/channel override
4747
}
4848

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ func (s *server) parseNotificationFromQuery(values url.Values) (types.Notificati
10221022
msg := types.NotificationMessage{
10231023
Type: values.Get("type"),
10241024
Title: values.Get("title"),
1025-
Content: values.Get("content"),
1025+
Message: values.Get("message"),
10261026
Room: values.Get("room"),
10271027
}
10281028

0 commit comments

Comments
 (0)