From bde8dece7283d800885b5c3a1db203a9a2aebc3d Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Fri, 15 Feb 2019 15:16:37 -0500 Subject: [PATCH] Updated Development_API (markdown) --- Development_API.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Development_API.md b/Development_API.md index 85c3ac5..310889c 100644 --- a/Development_API.md +++ b/Development_API.md @@ -99,19 +99,21 @@ apobj.notify(title='a title', body="a body", tag=["tagA", "TagB", ["TagC", "TagD apobj.notify(title="my title", body="my body") ``` -### Tagging and Categories -Another example would be a system owner filling their code with clean logic like: +#### Tagging and Categories +Another use case for tagging might be for a system owner to fill their code with clean logic like: ```python -#... +#... stuff happening apobj.notify(title='a title', body="a body", tag="service-message") -# ... + +# ... uh oh, something went wrong apobj.notify(title='a title', body="a body", tag="debug-message") -# ... + +# ... more stuff happening apobj.notify(title='a title', body="a body", tag="broadcast-notice") # ... ``` -Then somewhere when the Apprise Object (_apobj_) is first created, you poll your user for their settings and only load what they're interested in: +The idea would be that somewhere when the Apprise Object (_apobj_) was first created, you (as a system owner) would have retrieved the user settings and only load the tags based on what they're interested in: ```python # import our library import apprise @@ -121,16 +123,12 @@ apobj = apprise.Apprise() # Poll our user for their setting and add them apobj.add('mailto://myuser:theirpassword@hotmail.com', tag=[ - # Services we want to subscribe to + # Services we want our user subscribed to: "service-message", "broadcast-notice" ]) - -# Note that in this example, the user would never be notified for -# "debug-message" calls. Yet the system owner does not need to provide -# any additional logic around this call to perform this filter since -# apprise will take care of it for you. ``` +**Takeaway**: In this example (above), the user would never be notified for "_debug-message_" calls. Yet the developer of this system does not need to provide any additional logic around the apprise calls other than the _tag_ that should trigger the notification. Just let _Apprise_ handle the logic of what notifications to send for you. #### Message Types and Themes By default, all notifications are sent as type **NotifyType.INFO** using the _default_ theme. The following other types are included with this theme: