mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
Add customizable invite-new-user text.
This makes life a lot easier for people inviting users to a new Zulip organization, since they can give some form of context now. Modified by tabbott to clean up CSS, backend code flow, and improve the formatting of the emails. Fixes: #1409.
This commit is contained in:
@@ -201,6 +201,14 @@ def find_key_by_email(address):
|
||||
if address in message.to:
|
||||
return key_regex.search(message.body).groups()[0]
|
||||
|
||||
def find_pattern_in_email(address, pattern):
|
||||
# type: (Text, Text) -> Text
|
||||
from django.core.mail import outbox
|
||||
key_regex = re.compile(pattern)
|
||||
for message in reversed(outbox):
|
||||
if address in message.to:
|
||||
return key_regex.search(message.body).group(0)
|
||||
|
||||
def message_ids(result):
|
||||
# type: (Dict[str, Any]) -> Set[int]
|
||||
return set(message['id'] for message in result['messages'])
|
||||
|
||||
Reference in New Issue
Block a user