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:
|
if __auth == None:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
__TEAM = __auth["team"]
|
__TEAM = __auth["team"]
|
||||||
|
__URL = __auth["url"].rstrip("/")
|
||||||
__USER = users.info(__auth["user_id"])
|
__USER = users.info(__auth["user_id"])
|
||||||
|
|
||||||
|
|
||||||
def team():
|
def team():
|
||||||
return __TEAM
|
return __TEAM
|
||||||
|
|
||||||
|
def url():
|
||||||
|
return __URL
|
||||||
|
|
||||||
def user():
|
def user():
|
||||||
return __USER
|
return __USER
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,9 @@ class Thread:
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.__name
|
return self.__name
|
||||||
|
|
||||||
|
def url(self, base):
|
||||||
|
return "%s/messages/%s/" % (base, self.__name)
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
if self.__last_ts == None:
|
if self.__last_ts == None:
|
||||||
self.fetch_info()
|
self.fetch_info()
|
||||||
|
|
|
@ -21,6 +21,7 @@ def mail_thread(thread):
|
||||||
text = [ header, "" ]
|
text = [ header, "" ]
|
||||||
for message in thread.read():
|
for message in thread.read():
|
||||||
text += [ str(message) ]
|
text += [ str(message) ]
|
||||||
|
text += [ "\n", thread.url(slack.url()) ]
|
||||||
|
|
||||||
print("\n".join(text))
|
print("\n".join(text))
|
||||||
print()
|
print()
|
||||||
|
|
Loading…
Reference in New Issue