From 9d117499511b5015d212cc06c98440778ab44551 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Fri, 18 Sep 2020 12:05:37 -0400 Subject: [PATCH] Updated Development_API (markdown) --- Development_API.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Development_API.md b/Development_API.md index 65eeb76..15417ae 100644 --- a/Development_API.md +++ b/Development_API.md @@ -71,6 +71,27 @@ apobj.notify( title='my notification title', ) ``` + +Developers should know that Apprise passes everything it gets _as is_ which will work for most circumstances. However sometimes it's useful to let apprise know the data you're feeding it. This information is used to guarantee that the upstream provider can handle the content, and if it can't, it _will be modified_ so that it does. +```python +# Include the NotifyFormat object +from apprise import NotifyFormat + +# our body might be read from a file, it might be just input from +# our end users +body=""" +...a lot of content +that could span multiple lines ... +""" + +# Now we can send our notification while controlling the input source +# and knowing the upstream plugins will be able to handle it +apobj.notify( + body=body, + # Possible formats are TEXT, MARDOWN, and HTML + body_format=NotifyFormat.TEXT, +) +``` #### 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: