fraschetti / Octoslack

OctoPrint plugin for Slack, Mattermost, Pushbullet, Pushover, Rocket.Chat, Discord, Riot/Matrix, & Microsoft Teams
MIT License
74 stars 34 forks source link

Apprise Integration #67

Open caronc opened 4 years ago

caronc commented 4 years ago

Hi,

Just curious what's involved in adding Apprise as notification support? You just need to get a string of Apprise URLs from the end user (separated by space and/or comma) for input.

Your back-end logic would look something like this:

# requirements: pip install apprise
import apprise

# object initialization
obj = apprise.Apprise()

# add url(s) passed back from your user interface:
obj.add(self._settings.get('apprise_urls'))

# Send the notification(s) - notifies all url's added:
obj.notify("a message body", title="a message title")

This opens you up to 50+ services :slightly_smiling_face:

I was going to do a PR, but i don't have a 3D printer, so i can't really test anything I push upstream to you. I have a colleague at work who uses your software for his printing and was looking for a notification service you don't quite support yet. But Apprise would fix that.

Thoughts?