mirror of
https://github.com/caronc/apprise.git
synced 2025-03-04 10:01:39 +01:00
Updated Development_API (markdown)
parent
bde8dece72
commit
faf4ccd843
@ -70,7 +70,7 @@ apobj.notify(
|
||||
)
|
||||
```
|
||||
#### Leverage Tagging
|
||||
If you associated tags with your notification services (when you called **add()** earlier, you can leverage it's full potential through the **notify()** function here. Tagging however allows you to trigger notifications only when a criteria is met. The tagging logic can be interpreted as follows:
|
||||
If you associated tags with your notification services when you called **add()** earlier, you can leverage it's full potential through the **notify()** function here. Tagging however allows you to trigger notifications only when a criteria is met. The tagging logic can be interpreted as follows:
|
||||
|
||||
| apprise.notify(tag=**match**) | Tag Representation |
|
||||
| -------------------------------- | ------------------------ |
|
||||
@ -84,23 +84,27 @@ If you associated tags with your notification services (when you called **add()*
|
||||
Now that we've added our services and assigned them tags, this is how we can access them:
|
||||
```python
|
||||
# Has TagA
|
||||
apobj.notify(title='a title', body="a body", tag="tagA")
|
||||
apobj.notify(
|
||||
title='a title', body="a body", tag="tagA")
|
||||
|
||||
# Has TagA OR TagB
|
||||
apobj.notify(title='a title', body="a body", tag=["tagA", "TagB"])
|
||||
apobj.notify(
|
||||
title='a title', body="a body", tag=["tagA", "TagB"])
|
||||
|
||||
# Has TagA AND TagB
|
||||
apobj.notify(title='a title', body="a body", tag=[("tagA", "TagB")])
|
||||
apobj.notify(
|
||||
title='a title', body="a body", tag=[("tagA", "TagB")])
|
||||
|
||||
# Has TagA OR TagB OR (TagC AND TagD)
|
||||
apobj.notify(title='a title', body="a body", tag=["tagA", "TagB", ["TagC", "TagD"]])
|
||||
apobj.notify(
|
||||
title='a title', body="a body", tag=["tagA", "TagB", ["TagC", "TagD"]])
|
||||
|
||||
# No reference to tags; alert all of the added services
|
||||
apobj.notify(title="my title", body="my body")
|
||||
```
|
||||
|
||||
#### Tagging and Categories
|
||||
Another use case for tagging might be for a system owner to 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
|
||||
#... stuff happening
|
||||
apobj.notify(title='a title', body="a body", tag="service-message")
|
||||
|
Loading…
Reference in New Issue
Block a user