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:
Anna Schumaker 2016-11-16 09:39:46 -05:00
parent adbfd6d2d6
commit 2779e13692
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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()

View File

@ -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()