mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-18 11:49:56 +02:00
Redo submitter notification logic with clearer understanding of
implementation.
This commit is contained in:
@@ -138,34 +138,15 @@ def process_email_notifications_for_ticket_update(
|
|||||||
Sends email notifications when the ticket is updated in any way.
|
Sends email notifications when the ticket is updated in any way.
|
||||||
"""
|
"""
|
||||||
template_prefix = get_email_template_prefix(reassigned, follow_up)
|
template_prefix = get_email_template_prefix(reassigned, follow_up)
|
||||||
roles = {}
|
if helpdesk_settings.HELPDESK_NOTIFY_SUBMITTER_FOR_ALL_TICKET_CHANGES or (public and (
|
||||||
if public and (
|
|
||||||
follow_up.comment
|
follow_up.comment
|
||||||
or (follow_up.new_status in (Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS))
|
or (follow_up.new_status in (Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS)))
|
||||||
):
|
):
|
||||||
# For public tickets we do not want to send the assigned template for backwards compatibility
|
# Use hard coded prefix for submitter updates on tickets for backwards compatibility
|
||||||
# TODO: possibly make the template prefix modification configurable
|
# TODO: possibly make the template prefix modification configurable
|
||||||
pub_template_prefix = (
|
|
||||||
"updated_" if template_prefix == "assigned_" else template_prefix
|
|
||||||
)
|
|
||||||
roles.update(
|
|
||||||
{
|
|
||||||
"submitter": (pub_template_prefix + "submitter", context),
|
|
||||||
"ticket_cc": (pub_template_prefix + "cc", context),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
if helpdesk_settings.HELPDESK_SEND_EMAIL_NOTIFICATION_FOR_INTERNAL_TICKET_UPDATES:
|
|
||||||
roles.update(
|
|
||||||
{
|
|
||||||
"submitter": (template_prefix + "submitter", context),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if roles:
|
|
||||||
messages_sent_to.update(
|
messages_sent_to.update(
|
||||||
ticket.send(
|
ticket.send(
|
||||||
roles,
|
{"submitter": ("update_submitter", context),},
|
||||||
dont_send_to=messages_sent_to,
|
dont_send_to=messages_sent_to,
|
||||||
fail_silently=True,
|
fail_silently=True,
|
||||||
files=files,
|
files=files,
|
||||||
|
Reference in New Issue
Block a user