Fix #160 - send e-mails to ticket CC list even if there is no ticket submitter

This commit is contained in:
Ross Poulton 2013-01-21 17:25:14 +11:00
parent 22b68430df
commit 6c440f3ed0

View File

@ -483,7 +483,8 @@ def update_ticket(request, ticket_id, public=False):
comment=f.comment, comment=f.comment,
) )
if ticket.submitter_email and public and (f.comment or (f.new_status in (Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS))): if public and (f.comment or (f.new_status in (Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS))):
if f.new_status == Ticket.RESOLVED_STATUS: if f.new_status == Ticket.RESOLVED_STATUS:
template = 'resolved_submitter' template = 'resolved_submitter'
@ -492,15 +493,16 @@ def update_ticket(request, ticket_id, public=False):
else: else:
template = 'updated_submitter' template = 'updated_submitter'
send_templated_mail( if ticket.submitter_email:
template, send_templated_mail(
context, template,
recipients=ticket.submitter_email, context,
sender=ticket.queue.from_address, recipients=ticket.submitter_email,
fail_silently=True, sender=ticket.queue.from_address,
files=files, fail_silently=True,
) files=files,
messages_sent_to.append(ticket.submitter_email) )
messages_sent_to.append(ticket.submitter_email)
for cc in ticket.ticketcc_set.all(): for cc in ticket.ticketcc_set.all():
if cc.email_address not in messages_sent_to: if cc.email_address not in messages_sent_to: