Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4895] outgoing email logging improvements #4905

Merged

Conversation

viktorvanwijk
Copy link
Contributor

@viktorvanwijk viktorvanwijk commented Dec 11, 2024

Closes #4895

Changes

Add custom headers to confirmation and cosign emails

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@viktorvanwijk viktorvanwijk changed the title Issue/4895 outgoing email logging improvements [#4895] outgoing email logging improvements Dec 11, 2024
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.57%. Comparing base (3ae753c) to head (9441219).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4905   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files         757      757           
  Lines       25728    25730    +2     
  Branches     3379     3379           
=======================================
+ Hits        24847    24849    +2     
  Misses        616      616           
  Partials      265      265           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -302,3 +303,33 @@ def test_cancel_and_change_instructions(self):
with self.subTest(type="plain text"):
self.assertIn(cancel_link, message_text)
self.assertNotIn(change_link, message_text)

def test_headers_present_in_confirmation_email(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to have this test in the submissions app instead of appointments, since it's not something exclusive or special to appointments - even for non-appointment submissions we expect these confirmation emails (with custom headers) to be sent.

"Content-Language": submission.language_code,
X_OF_CONTENT_TYPE_HEADER: EmailContentTypeChoices.submission,
X_OF_CONTENT_UUID_HEADER: str(submission.uuid),
X_OF_EVENT_HEADER: EmailEventChoices.cosign_confirmation,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This email isn't a cosign confirmation email, but rather a cosign request. To be fair, I think the original code defining the event is wrong and should be renamed to 'cosign-request', since the cosign confirmation is not much different from the "normal" confirmation email (if I remember correctly).

@viktorvanwijk viktorvanwijk force-pushed the issue/4895-outgoing-email-logging-improvements branch from 03d38b9 to 0fdd871 Compare December 12, 2024 10:09
@viktorvanwijk viktorvanwijk force-pushed the issue/4895-outgoing-email-logging-improvements branch from 0fdd871 to 9441219 Compare December 12, 2024 10:19
Copy link
Member

@sergei-maertens sergei-maertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@sergei-maertens sergei-maertens merged commit 0dd2174 into master Dec 12, 2024
33 checks passed
@sergei-maertens sergei-maertens deleted the issue/4895-outgoing-email-logging-improvements branch December 12, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outgoing email logging improvements
2 participants