diff --git a/helpdesk/email.py b/helpdesk/email.py index c454d5a2..d9a89325 100644 --- a/helpdesk/email.py +++ b/helpdesk/email.py @@ -25,6 +25,7 @@ from helpdesk import webhooks 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 import imaplib import logging import mimetypes @@ -618,7 +619,8 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger) else: send_info_email(message_id, f, ticket, context, queue, new) if not new: - webhooks.notify_followup_webhooks(f) + # emit signal with followup when the ticket is updated + update_ticket_done.send(sender="create_object_from_email_message", followup=f) return ticket diff --git a/helpdesk/webhooks.py b/helpdesk/webhooks.py index 0eb33133..c1050581 100644 --- a/helpdesk/webhooks.py +++ b/helpdesk/webhooks.py @@ -36,8 +36,7 @@ def notify_followup_webhooks(followup): # listener is loaded via app.py HelpdeskConfig.ready() @receiver(update_ticket_done) def notify_followup_webhooks_receiver(sender, followup, **kwargs): - if sender == "update_ticket": - notify_followup_webhooks(followup) + notify_followup_webhooks(followup) def send_new_ticket_webhook(ticket):