[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:
Tim Abbott 2013-05-02 13:41:09 -04:00
parent db4ff2ce56
commit f0e6618b66

View file

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