mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-16 02:48:00 +02:00
Nullable "default_owner" field added to Queue model
If default_owner is specified, tickets from public form will be assigned to him and he'll be notified by email
This commit is contained in:
@ -406,6 +406,9 @@ class PublicTicketForm(CustomFieldMixin, forms.Form):
|
||||
due_date = self.cleaned_data['due_date'],
|
||||
)
|
||||
|
||||
if q.default_owner and not t.assigned_to:
|
||||
t.assigned_to = q.default_owner
|
||||
|
||||
t.save()
|
||||
|
||||
for field, value in self.cleaned_data.items():
|
||||
@ -460,6 +463,17 @@ class PublicTicketForm(CustomFieldMixin, forms.Form):
|
||||
)
|
||||
messages_sent_to.append(t.submitter_email)
|
||||
|
||||
if t.assigned_to and t.assigned_to.usersettings.settings.get('email_on_ticket_assign', False) and t.assigned_to.email and t.assigned_to.email not in messages_sent_to:
|
||||
send_templated_mail(
|
||||
'assigned_owner',
|
||||
context,
|
||||
recipients=t.assigned_to.email,
|
||||
sender=q.from_address,
|
||||
fail_silently=True,
|
||||
files=files,
|
||||
)
|
||||
messages_sent_to.append(t.assigned_to.email)
|
||||
|
||||
if q.new_ticket_cc and q.new_ticket_cc not in messages_sent_to:
|
||||
send_templated_mail(
|
||||
'newticket_cc',
|
||||
|
Reference in New Issue
Block a user