From ce018d2ce51522c82a780b7acd6ff5d8d0f9a103 Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Sat, 25 May 2019 01:01:02 -0400 Subject: [PATCH] Copy emails to CC list when processing with get_email, for #744 --- helpdesk/management/commands/get_email.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index 5ae13079..1c608cde 100755 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -545,6 +545,18 @@ def ticket_from_message(message, queue, logger): sender=queue.from_address, fail_silently=True, ) + # copy email to all those CC'd to this particular ticket + for cc in t.ticketcc_set.all(): + # don't duplicate email to assignee + if t.assigned_to.email != cc.email_address: + send_templated_mail( + 'updated_cc', + context, + recipients=cc.email_address, + sender=queue.from_address, + fail_silently=True, + ) + return t