From f0e6618b6609cd6bfc1f7c5a5f470a9e50d03293 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 2 May 2013 13:41:09 -0400 Subject: [PATCH] [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) --- bots/feedback-bot | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bots/feedback-bot b/bots/feedback-bot index 973dc26..7699ba7 100755 --- a/bots/feedback-bot +++ b/bots/feedback-bot @@ -46,10 +46,16 @@ staging_client = humbug.Client( def forward_message(message): if message["type"] != "private" or len(message["display_recipient"]) != 2: 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 = { "type": "stream", "to": "support", - "subject": "feedback from %s" % message["sender_email"], + "subject": subject, "content": message["content"], } staging_client.send_message(forwarded_message)