From 9263d9fbf279f977157258c9f1d295a83de2c4fa Mon Sep 17 00:00:00 2001 From: Rebecca Cremona Date: Tue, 10 Oct 2023 14:04:50 -0400 Subject: [PATCH] Append a UUID to our contact email's subject line, to help with threading. --- perma_web/perma/views/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perma_web/perma/views/common.py b/perma_web/perma/views/common.py index f6050b093..41198b89c 100755 --- a/perma_web/perma/views/common.py +++ b/perma_web/perma/views/common.py @@ -4,6 +4,7 @@ from io import StringIO from link_header import Link as Rel, LinkHeader from urllib.parse import urlencode +import uuid from timegate.utils import closest from warcio.timeutils import datetime_to_http_date from werkzeug.http import parse_date @@ -393,7 +394,7 @@ def handle_registrar_fields(form): if form.is_valid(): # Assemble info for email from_address = form.cleaned_data['email'] - subject = "[perma-contact] " + form.cleaned_data['subject'] + subject = f"[perma-contact] {form.cleaned_data['subject']} ({str(uuid.uuid4())})" context = { "message": form.cleaned_data['box2'], "from_address": from_address, @@ -499,7 +500,7 @@ def affiliation_string(): if form.is_valid(): if form.cleaned_data['guid']: from_address = form.cleaned_data['email'] - subject = "[perma-contact] Reporting Inappropriate Content" + subject = f"[perma-contact] Reporting Inappropriate Content ({str(uuid.uuid4())})" context = { "reason": form.cleaned_data['reason'], "source": form.cleaned_data['source'],