Skip to content

Commit

Permalink
new_ticket_done signal emitted through email
Browse files Browse the repository at this point in the history
  • Loading branch information
samsplunks committed Apr 17, 2024
1 parent 81f9226 commit 2fc95d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions helpdesk/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from helpdesk.exceptions import DeleteIgnoredTicketException, IgnoreTicketException
from helpdesk.lib import process_attachments, safe_template_context
from helpdesk.models import FollowUp, IgnoreEmail, Queue, Ticket
from helpdesk.signals import update_ticket_done
from helpdesk.signals import new_ticket_done, update_ticket_done
import imaplib
import logging
import mimetypes
Expand Down Expand Up @@ -617,7 +617,10 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger)
"Message seems to be auto-reply, not sending any emails back to the sender")
else:
send_info_email(message_id, f, ticket, context, queue, new)
if not new:
if new:
# emit signal when the PublicTicketForm.save is done
new_ticket_done.send(sender="create_object_from_email_message", ticket=ticket)
else:
# emit signal with followup when the ticket is updated
update_ticket_done.send(sender="create_object_from_email_message", followup=f)
return ticket
Expand Down

0 comments on commit 2fc95d1

Please sign in to comment.