Fix rendering for publish example
parent
66d30fb42a
commit
c1517e259d
|
@ -163,11 +163,11 @@ a [title](#message-title), and [tag messages](#tags-emojis) 🥳 🎉. Here's an
|
||||||
<figcaption>Urgent notification with tags and title</figcaption>
|
<figcaption>Urgent notification with tags and title</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
||||||
You can also do multi-line messages. Here's an example using a click action, a user action, with an external image attachment and forwarded via email:
|
You can also do multi-line messages. Here's an example using a [click action](#click-action), an [action button](#action-buttons),
|
||||||
|
an [external image attachment](#attach-file-from-a-url) and [email publishing](#e-mail-publishing):
|
||||||
|
|
||||||
=== "Command line (curl)"
|
=== "Command line (curl)"
|
||||||
``` sh
|
```
|
||||||
#!/bin/bash
|
|
||||||
curl \
|
curl \
|
||||||
-H "Click: https://home.nest.com/" \
|
-H "Click: https://home.nest.com/" \
|
||||||
-H "Attach: https://nest.com/view/yAxkasd.jpg" \
|
-H "Attach: https://nest.com/view/yAxkasd.jpg" \
|
||||||
|
@ -175,23 +175,23 @@ You can also do multi-line messages. Here's an example using a click action, a u
|
||||||
-H "Email: phil@example.com" \
|
-H "Email: phil@example.com" \
|
||||||
-d "There's someone at the door. 🐶
|
-d "There's someone at the door. 🐶
|
||||||
|
|
||||||
Please check if it's a good boy or a hooman.
|
Please check if it's a good boy or a hooman.
|
||||||
Doggies have been known to ring the doorbell." \
|
Doggies have been known to ring the doorbell." \
|
||||||
ntfy.sh/mydoorbell
|
ntfy.sh/mydoorbell
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "ntfy CLI"
|
=== "ntfy CLI"
|
||||||
```
|
```
|
||||||
ntfy publish \
|
ntfy publish \
|
||||||
--click="https://home.nest.com/" \
|
--click="https://home.nest.com/" \
|
||||||
--attach="https://nest.com/view/yAxkasd.jpg" \
|
--attach="https://nest.com/view/yAxkasd.jpg" \
|
||||||
--actions="http, Open door, https://api.nest.com/open/yAxkasd, clear=true" \
|
--actions="http, Open door, https://api.nest.com/open/yAxkasd, clear=true" \
|
||||||
--email="phil@example.com"
|
--email="phil@example.com" \
|
||||||
mydoorbell \
|
mydoorbell \
|
||||||
"There's someone at the door. 🐶
|
"There's someone at the door. 🐶
|
||||||
|
|
||||||
Please check if it's a good boy or a hooman.
|
Please check if it's a good boy or a hooman.
|
||||||
Doggies have been known to ring the doorbell."
|
Doggies have been known to ring the doorbell."
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "HTTP"
|
=== "HTTP"
|
||||||
|
@ -213,16 +213,16 @@ Doggies have been known to ring the doorbell."
|
||||||
``` javascript
|
``` javascript
|
||||||
fetch('https://ntfy.sh/mydoorbell', {
|
fetch('https://ntfy.sh/mydoorbell', {
|
||||||
method: 'POST', // PUT works too
|
method: 'POST', // PUT works too
|
||||||
headers: {
|
headers: {
|
||||||
'Click': 'https://home.nest.com/',
|
'Click': 'https://home.nest.com/',
|
||||||
'Attach': 'https://nest.com/view/yAxkasd.jpg',
|
'Attach': 'https://nest.com/view/yAxkasd.jpg',
|
||||||
'Actions': 'http, Open door, https://api.nest.com/open/yAxkasd, clear=true',
|
'Actions': 'http, Open door, https://api.nest.com/open/yAxkasd, clear=true',
|
||||||
'Email': 'phil@example.com'
|
'Email': 'phil@example.com'
|
||||||
},
|
},
|
||||||
body: `There's someone at the door. 🐶
|
body: `There's someone at the door. 🐶
|
||||||
|
|
||||||
Please check if it's a good boy or a hooman.
|
Please check if it's a good boy or a hooman.
|
||||||
Doggies have been known to ring the doorbell.`,
|
Doggies have been known to ring the doorbell.`,
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -231,8 +231,8 @@ Doggies have been known to ring the doorbell.`,
|
||||||
req, _ := http.NewRequest("POST", "https://ntfy.sh/mydoorbell",
|
req, _ := http.NewRequest("POST", "https://ntfy.sh/mydoorbell",
|
||||||
strings.NewReader(`There's someone at the door. 🐶
|
strings.NewReader(`There's someone at the door. 🐶
|
||||||
|
|
||||||
Please check if it's a good boy or a hooman.
|
Please check if it's a good boy or a hooman.
|
||||||
Doggies have been known to ring the doorbell.`))
|
Doggies have been known to ring the doorbell.`))
|
||||||
req.Header.Set("Click", "https://home.nest.com/")
|
req.Header.Set("Click", "https://home.nest.com/")
|
||||||
req.Header.Set("Attach", "https://nest.com/view/yAxkasd.jpg")
|
req.Header.Set("Attach", "https://nest.com/view/yAxkasd.jpg")
|
||||||
req.Header.Set("Actions", "http, Open door, https://api.nest.com/open/yAxkasd, clear=true")
|
req.Header.Set("Actions", "http, Open door, https://api.nest.com/open/yAxkasd, clear=true")
|
||||||
|
@ -245,14 +245,14 @@ Doggies have been known to ring the doorbell.`))
|
||||||
$uri = "https://ntfy.sh/mydoorbell"
|
$uri = "https://ntfy.sh/mydoorbell"
|
||||||
$headers = @{ Click="https://home.nest.com/"
|
$headers = @{ Click="https://home.nest.com/"
|
||||||
Attach="https://nest.com/view/yAxkasd.jpg"
|
Attach="https://nest.com/view/yAxkasd.jpg"
|
||||||
Actions="http, Open door, https://api.nest.com/open/yAxkasd, clear=true"
|
Actions="http, Open door, https://api.nest.com/open/yAxkasd, clear=true"
|
||||||
Email="phil@example.com"}
|
Email="phil@example.com" }
|
||||||
$body = @'
|
$body = @'
|
||||||
There's someone at the door. 🐶
|
There's someone at the door. 🐶
|
||||||
|
|
||||||
Please check if it's a good boy or a hooman.
|
Please check if it's a good boy or a hooman.
|
||||||
Doggies have been known to ring the doorbell.
|
Doggies have been known to ring the doorbell.
|
||||||
'@
|
'@
|
||||||
Invoke-RestMethod -Method 'Post' -Uri $uri -Headers $headers -Body $body -UseBasicParsing
|
Invoke-RestMethod -Method 'Post' -Uri $uri -Headers $headers -Body $body -UseBasicParsing
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -261,8 +261,8 @@ Doggies have been known to ring the doorbell.
|
||||||
requests.post("https://ntfy.sh/mydoorbell",
|
requests.post("https://ntfy.sh/mydoorbell",
|
||||||
data="""There's someone at the door. 🐶
|
data="""There's someone at the door. 🐶
|
||||||
|
|
||||||
Please check if it's a good boy or a hooman.
|
Please check if it's a good boy or a hooman.
|
||||||
Doggies have been known to ring the doorbell.""".encode('utf-8'),
|
Doggies have been known to ring the doorbell.""".encode('utf-8'),
|
||||||
headers={
|
headers={
|
||||||
"Click": "https://home.nest.com/",
|
"Click": "https://home.nest.com/",
|
||||||
"Attach": "https://nest.com/view/yAxkasd.jpg",
|
"Attach": "https://nest.com/view/yAxkasd.jpg",
|
||||||
|
@ -280,18 +280,18 @@ Doggies have been known to ring the doorbell.""".encode('utf-8'),
|
||||||
"Content-Type: text/plain\r\n" .
|
"Content-Type: text/plain\r\n" .
|
||||||
"Click: https://home.nest.com/\r\n" .
|
"Click: https://home.nest.com/\r\n" .
|
||||||
"Attach: https://nest.com/view/yAxkasd.jpg\r\n" .
|
"Attach: https://nest.com/view/yAxkasd.jpg\r\n" .
|
||||||
"Actions": "http, Open door, https://api.nest.com/open/yAxkasd, clear=true\r\n" .
|
"Actions": "http, Open door, https://api.nest.com/open/yAxkasd, clear=true\r\n" .
|
||||||
"Email": "phil@example.com\r\n" ,
|
"Email": "phil@example.com\r\n",
|
||||||
'content' => 'There's someone at the door. 🐶
|
'content' => 'There\'s someone at the door. 🐶
|
||||||
|
|
||||||
Please check if it's a good boy or a hooman.
|
Please check if it\'s a good boy or a hooman.
|
||||||
Doggies have been known to ring the doorbell.'
|
Doggies have been known to ring the doorbell.'
|
||||||
]
|
]
|
||||||
]));
|
]));
|
||||||
```
|
```
|
||||||
|
|
||||||
<figure markdown>
|
<figure markdown>
|
||||||
![priority notification](static/img/complete-notification.jpg){ width=500 }
|
![priority notification](static/img/android-screenshot-notification-multiline.jpg){ width=500 }
|
||||||
<figcaption>Notification using a click action, a user action, with an external image attachment and forwarded via email</figcaption>
|
<figcaption>Notification using a click action, a user action, with an external image attachment and forwarded via email</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ to [@Joeharrison94](https://github.com/Joeharrison94) for the input.
|
||||||
**Documentation:**
|
**Documentation:**
|
||||||
|
|
||||||
* Improved caddy configuration (no ticket, thanks to @Stnby)
|
* Improved caddy configuration (no ticket, thanks to @Stnby)
|
||||||
|
* Additional multi-line examples on the [publish page](https://ntfy.sh/docs/publish/) ([#234](https://github.com/binwiederhier/ntfy/pull/234), thanks to [@aTable](https://github.com/aTable))
|
||||||
|
|
||||||
**Additional translations:**
|
**Additional translations:**
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Loading…
Reference in New Issue