mirror of
https://github.com/caronc/apprise.git
synced 2024-12-13 10:21:51 +01:00
title is the second argument, not first.
parent
b34a56ed48
commit
63abac9748
@ -67,8 +67,8 @@ You can now send a notification to all of the loaded notifications services by j
|
|||||||
# Then notify these services any time you desire. The below would
|
# Then notify these services any time you desire. The below would
|
||||||
# notify all of the services loaded into our Apprise object.
|
# notify all of the services loaded into our Apprise object.
|
||||||
apobj.notify(
|
apobj.notify(
|
||||||
title='my notification title',
|
|
||||||
body='what a great notification service!',
|
body='what a great notification service!',
|
||||||
|
title='my notification title',
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
#### Leverage Tagging
|
#### Leverage Tagging
|
||||||
@ -86,35 +86,35 @@ Now that we've added our services and assigned them tags, this is how we can acc
|
|||||||
```python
|
```python
|
||||||
# Has TagA
|
# Has TagA
|
||||||
apobj.notify(
|
apobj.notify(
|
||||||
title='a title', body="a body", tag="tagA")
|
body="a body", title='a title', tag="tagA")
|
||||||
|
|
||||||
# Has TagA OR TagB
|
# Has TagA OR TagB
|
||||||
apobj.notify(
|
apobj.notify(
|
||||||
title='a title', body="a body", tag=["tagA", "TagB"])
|
body="a body", title='a title', tag=["tagA", "TagB"])
|
||||||
|
|
||||||
# Has TagA AND TagB
|
# Has TagA AND TagB
|
||||||
apobj.notify(
|
apobj.notify(
|
||||||
title='a title', body="a body", tag=[("tagA", "TagB")])
|
body="a body", title='a title', tag=[("tagA", "TagB")])
|
||||||
|
|
||||||
# Has TagA OR TagB OR (TagC AND TagD)
|
# Has TagA OR TagB OR (TagC AND TagD)
|
||||||
apobj.notify(
|
apobj.notify(
|
||||||
title='a title', body="a body", tag=["tagA", "TagB", ["TagC", "TagD"]])
|
body="a body", title='a title', tag=["tagA", "TagB", ["TagC", "TagD"]])
|
||||||
|
|
||||||
# No reference to tags; alert all of the added services
|
# No reference to tags; alert all of the added services
|
||||||
apobj.notify(title="my title", body="my body")
|
apobj.notify(body="my body", title="my title")
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Tagging and Categories
|
#### Tagging and Categories
|
||||||
Another use case for tagging might be to instead interpret them as categories. A system owner could simply fill their code with clean logic like:
|
Another use case for tagging might be to instead interpret them as categories. A system owner could simply fill their code with clean logic like:
|
||||||
```python
|
```python
|
||||||
#... stuff happening
|
#... stuff happening
|
||||||
apobj.notify(title='a title', body="a body", tag="service-message")
|
apobj.notify(body="a body", title='a title', tag="service-message")
|
||||||
|
|
||||||
# ... uh oh, something went wrong
|
# ... uh oh, something went wrong
|
||||||
apobj.notify(title='a title', body="a body", tag="debug-message")
|
apobj.notify(body="a body", title='a title', tag="debug-message")
|
||||||
|
|
||||||
# ... more stuff happening
|
# ... more stuff happening
|
||||||
apobj.notify(title='a title', body="a body", tag="broadcast-notice")
|
apobj.notify(body="a body", title='a title', tag="broadcast-notice")
|
||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -153,8 +153,8 @@ from apprise import NotifyType
|
|||||||
# Then notify these services any time you desire. The below would
|
# Then notify these services any time you desire. The below would
|
||||||
# notify all of the services loaded into our Apprise object as a WARNING.
|
# notify all of the services loaded into our Apprise object as a WARNING.
|
||||||
apobj.notify(
|
apobj.notify(
|
||||||
title='my notification title',
|
|
||||||
body='what a great notification service!',
|
body='what a great notification service!',
|
||||||
|
title='my notification title',
|
||||||
notify_type=NotifyType.WARNING,
|
notify_type=NotifyType.WARNING,
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user