[manual] feedback-bot: Include sender domain in feedback messages.
feedback-bot needs to be updated and restarted after this is pushed to prod for these changes to take effect. (imported from commit fcabd2f4bb26c794454e096242a8073805fc786c)
This commit is contained in:
parent
db4ff2ce56
commit
f0e6618b66
|
@ -46,10 +46,16 @@ staging_client = humbug.Client(
|
||||||
def forward_message(message):
|
def forward_message(message):
|
||||||
if message["type"] != "private" or len(message["display_recipient"]) != 2:
|
if message["type"] != "private" or len(message["display_recipient"]) != 2:
|
||||||
return
|
return
|
||||||
|
if "sender_domain" in message:
|
||||||
|
subject = "feedback: %s (%s)" % (message["sender_email"], message["sender_domain"])
|
||||||
|
else:
|
||||||
|
subject = "feedback from %s" % message["sender_email"],
|
||||||
|
if len(subject) > 60:
|
||||||
|
subject = subject[:57].rstrip() + "..."
|
||||||
forwarded_message = {
|
forwarded_message = {
|
||||||
"type": "stream",
|
"type": "stream",
|
||||||
"to": "support",
|
"to": "support",
|
||||||
"subject": "feedback from %s" % message["sender_email"],
|
"subject": subject,
|
||||||
"content": message["content"],
|
"content": message["content"],
|
||||||
}
|
}
|
||||||
staging_client.send_message(forwarded_message)
|
staging_client.send_message(forwarded_message)
|
||||||
|
|
Loading…
Reference in a new issue