mirror of
https://github.com/caronc/apprise.git
synced 2024-12-12 09:51:05 +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
|
||||
# notify all of the services loaded into our Apprise object.
|
||||
apobj.notify(
|
||||
title='my notification title',
|
||||
body='what a great notification service!',
|
||||
title='my notification title',
|
||||
)
|
||||
```
|
||||
#### Leverage Tagging
|
||||
@ -86,35 +86,35 @@ Now that we've added our services and assigned them tags, this is how we can acc
|
||||
```python
|
||||
# Has TagA
|
||||
apobj.notify(
|
||||
title='a title', body="a body", tag="tagA")
|
||||
body="a body", title='a title', tag="tagA")
|
||||
|
||||
# Has TagA OR TagB
|
||||
apobj.notify(
|
||||
title='a title', body="a body", tag=["tagA", "TagB"])
|
||||
body="a body", title='a title', tag=["tagA", "TagB"])
|
||||
|
||||
# Has TagA AND TagB
|
||||
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)
|
||||
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
|
||||
apobj.notify(title="my title", body="my body")
|
||||
apobj.notify(body="my body", title="my title")
|
||||
```
|
||||
|
||||
#### 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:
|
||||
```python
|
||||
#... 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
|
||||
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
|
||||
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
|
||||
# notify all of the services loaded into our Apprise object as a WARNING.
|
||||
apobj.notify(
|
||||
title='my notification title',
|
||||
body='what a great notification service!',
|
||||
title='my notification title',
|
||||
notify_type=NotifyType.WARNING,
|
||||
)
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user