Skip to content

Commit

Permalink
respect Notifier.content (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote authored Nov 3, 2021
1 parent 4cac2c6 commit 2428de0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sa_tools_core/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,33 @@ def _func(*a, **kw):
raise AttributeError

def _wework(self, addrs, content=None, **kw):
content = content if content is not None else self.content
send_wework(addrs, content, msg_type=self.msg_type)

def _lark(self, addrs, content=None, **kw):
send_lark(addrs, content)

def _email(self, addrs, content=None, title=None, from_addr=None, **kw):
content = content if content is not None else self.content
send_mail(addrs, content, subject=title, from_addr=from_addr or self.from_addr)

def _pushbullet(self, addrs, content=None, title=None, **kw):
content = content if content is not None else self.content
for addr in addrs:
send_pushbullet(addr, title, content)

def _pushover(self, addrs, content=None, **kw):
content = content if content is not None else self.content
for addr in addrs:
send_pushover(addr, content)

def _telegram(self, addrs, content=None, **kw):
content = content if content is not None else self.content
for addr in addrs:
send_telegram(addr, content, msg_type=self.msg_type)

def _sms(self, addrs, content=None, **kw):
content = content if content is not None else self.content
for addr in addrs:
send_sms(addr, content)

Expand Down

0 comments on commit 2428de0

Please sign in to comment.