Add channel url to slack email
This gives us a link directly to the channel to read messages there. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
adbfd6d2d6
commit
2779e13692
|
@ -27,12 +27,16 @@ __auth = auth.test()
|
|||
if __auth == None:
|
||||
sys.exit(1)
|
||||
__TEAM = __auth["team"]
|
||||
__URL = __auth["url"].rstrip("/")
|
||||
__USER = users.info(__auth["user_id"])
|
||||
|
||||
|
||||
def team():
|
||||
return __TEAM
|
||||
|
||||
def url():
|
||||
return __URL
|
||||
|
||||
def user():
|
||||
return __USER
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@ class Thread:
|
|||
def name(self):
|
||||
return self.__name
|
||||
|
||||
def url(self, base):
|
||||
return "%s/messages/%s/" % (base, self.__name)
|
||||
|
||||
def read(self):
|
||||
if self.__last_ts == None:
|
||||
self.fetch_info()
|
||||
|
|
|
@ -21,6 +21,7 @@ def mail_thread(thread):
|
|||
text = [ header, "" ]
|
||||
for message in thread.read():
|
||||
text += [ str(message) ]
|
||||
text += [ "\n", thread.url(slack.url()) ]
|
||||
|
||||
print("\n".join(text))
|
||||
print()
|
||||
|
|
Loading…
Reference in New Issue