| 33 | return self.config.get("configs").split(',') |
| 34 | |
| 35 | def send(self, event, msg, key): |
| 36 | if not check_module("apprise"): |
| 37 | self.log_error(_("Cannot send notification: apprise is not installed."), |
| 38 | _("Install apprise by issuing 'pip install apprise' command.")) |
| 39 | return |
| 40 | |
| 41 | import apprise |
| 42 | |
| 43 | apprise_obj = apprise.Apprise() |
| 44 | apprise_config = apprise.AppriseConfig() |
| 45 | |
| 46 | for c in key: |
| 47 | apprise_config.add(c) |
| 48 | |
| 49 | apprise_obj.add(apprise_config) |
| 50 | |
| 51 | apprise_obj.notify(title=self.config.get("title"), |
| 52 | body="%s: %s" % (event, msg) if msg else event) |