From 6a4e88105171b93aa6d375199e82df152d649ac2 Mon Sep 17 00:00:00 2001 From: jedi Date: Fri, 26 Apr 2024 16:07:36 +0200 Subject: [PATCH] stash --- core/core/settings.py | 4 +++- core/mail/protocol.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/core/settings.py b/core/core/settings.py index fc0f8ef..945960b 100644 --- a/core/core/settings.py +++ b/core/core/settings.py @@ -29,7 +29,9 @@ SECRET_KEY = 'django-insecure-tm*$w_14iqbiy-!7(8#ba7j+_@(7@rf2&a^!=shs&$03b%2*rv # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [os.getenv('HTTP_HOST', 'localhost')] +PRIMARY_HOST = os.getenv('HTTP_HOST', 'localhost') + +ALLOWED_HOSTS = [PRIMARY_HOST] MAIL_DOMAIN = os.getenv('MAIL_DOMAIN', 'localhost') diff --git a/core/mail/protocol.py b/core/mail/protocol.py index 8e790e4..c0a4e50 100644 --- a/core/mail/protocol.py +++ b/core/mail/protocol.py @@ -4,6 +4,8 @@ import aiosmtplib from channels.layers import get_channel_layer from channels.db import database_sync_to_async from django.core.files.base import ContentFile + +from core.settings import PRIMARY_HOST from mail.models import Email, EventAddress, EmailAttachment from notify_sessions.models import SystemEvent from tickets.models import IssueThread @@ -255,9 +257,11 @@ Your c3lf (Cloakroom + Lost&Found) Team'''.format(active_issue_thread.short_uuid else: notify_subject = active_issue_thread.name if new: - notification = f"New issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] created by {sender}" + notification = f"""New issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] created + see https://{PRIMARY_HOST}/{target_event.slug}/ticket/{active_issue_thread.short_uuid.id}/""" else: - notification = f"Reply to issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] by {sender}" + notification = f"""Reply to issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] + see https://{PRIMARY_HOST}/{target_event.slug}/ticket/{active_issue_thread.short_uuid.id}/""" return email, new, reply, notification