mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 07:53:19 +01:00
Merge branch 'main' into stable
This commit is contained in:
commit
dc6db21368
@ -499,41 +499,44 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger)
|
|||||||
logger.info(
|
logger.info(
|
||||||
"Message seems to be auto-reply, not sending any emails back to the sender")
|
"Message seems to be auto-reply, not sending any emails back to the sender")
|
||||||
else:
|
else:
|
||||||
# send mail to appropriate people now depending on what objects
|
send_info_email(message_id, f, ticket, context, queue, new)
|
||||||
# were created and who was CC'd
|
|
||||||
# Add auto-reply headers because it's an auto-reply and we must
|
|
||||||
extra_headers = {
|
|
||||||
'In-Reply-To': message_id,
|
|
||||||
"Auto-Submitted": "auto-replied",
|
|
||||||
"X-Auto-Response-Suppress": "All",
|
|
||||||
"Precedence": "auto_reply",
|
|
||||||
}
|
|
||||||
if new:
|
|
||||||
ticket.send(
|
|
||||||
{'submitter': ('newticket_submitter', context),
|
|
||||||
'new_ticket_cc': ('newticket_cc', context),
|
|
||||||
'ticket_cc': ('newticket_cc', context)},
|
|
||||||
fail_silently=True,
|
|
||||||
extra_headers=extra_headers,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
context.update(comment=f.comment)
|
|
||||||
ticket.send(
|
|
||||||
{'submitter': ('newticket_submitter', context),
|
|
||||||
'assigned_to': ('updated_owner', context)},
|
|
||||||
fail_silently=True,
|
|
||||||
extra_headers=extra_headers,
|
|
||||||
)
|
|
||||||
if queue.enable_notifications_on_email_events:
|
|
||||||
ticket.send(
|
|
||||||
{'ticket_cc': ('updated_cc', context)},
|
|
||||||
fail_silently=True,
|
|
||||||
extra_headers=extra_headers,
|
|
||||||
)
|
|
||||||
|
|
||||||
return ticket
|
return ticket
|
||||||
|
|
||||||
|
|
||||||
|
def send_info_email(message_id: str, f: FollowUp, ticket: Ticket, context: dict, queue: dict, new: bool):
|
||||||
|
# send mail to appropriate people now depending on what objects
|
||||||
|
# were created and who was CC'd
|
||||||
|
# Add auto-reply headers because it's an auto-reply and we must
|
||||||
|
extra_headers = {
|
||||||
|
'In-Reply-To': message_id,
|
||||||
|
"Auto-Submitted": "auto-replied",
|
||||||
|
"X-Auto-Response-Suppress": "All",
|
||||||
|
"Precedence": "auto_reply",
|
||||||
|
}
|
||||||
|
if new:
|
||||||
|
ticket.send(
|
||||||
|
{'submitter': ('newticket_submitter', context),
|
||||||
|
'new_ticket_cc': ('newticket_cc', context),
|
||||||
|
'ticket_cc': ('newticket_cc', context)},
|
||||||
|
fail_silently=True,
|
||||||
|
extra_headers=extra_headers,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
context.update(comment=f.comment)
|
||||||
|
ticket.send(
|
||||||
|
{'submitter': ('newticket_submitter', context),
|
||||||
|
'assigned_to': ('updated_owner', context)},
|
||||||
|
fail_silently=True,
|
||||||
|
extra_headers=extra_headers,
|
||||||
|
)
|
||||||
|
if queue.enable_notifications_on_email_events:
|
||||||
|
ticket.send(
|
||||||
|
{'ticket_cc': ('updated_cc', context)},
|
||||||
|
fail_silently=True,
|
||||||
|
extra_headers=extra_headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_ticket_id_from_subject_slug(
|
def get_ticket_id_from_subject_slug(
|
||||||
queue_slug: str,
|
queue_slug: str,
|
||||||
subject: str,
|
subject: str,
|
||||||
|
@ -81,12 +81,12 @@ def text_is_spam(text, request):
|
|||||||
# This will return 'True' is the given text is deemed to be spam, or
|
# This will return 'True' is the given text is deemed to be spam, or
|
||||||
# False if it is not spam. If it cannot be checked for some reason, we
|
# False if it is not spam. If it cannot be checked for some reason, we
|
||||||
# assume it isn't spam.
|
# assume it isn't spam.
|
||||||
from django.contrib.sites.models import Site
|
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
|
||||||
try:
|
try:
|
||||||
from akismet import Akismet
|
from akismet import Akismet
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return False
|
return False
|
||||||
|
from django.contrib.sites.models import Site
|
||||||
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
try:
|
try:
|
||||||
site = Site.objects.get_current()
|
site = Site.objects.get_current()
|
||||||
except ImproperlyConfigured:
|
except ImproperlyConfigured:
|
||||||
|
Loading…
Reference in New Issue
Block a user