-
Notifications
You must be signed in to change notification settings - Fork 23
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
Improve visibility/tracing of email delivery #3402
Comments
Not sure if the ordering of events allows it but isn't it easier to create a |
This feels like duplicating django-yubin, they already have a This approach would also have to rely on generic foreign keys which bring their own set of problems and don't have any integrity guarantees. Using the email headers is imo much more end-to-end reliable since you can correlate what is being sent and logged on our end with the actual emails being delivered (or not) to mailboxes. It's a similar approach to (distributed) tracing like APM/Jaeger for microservices. |
I'm leaving the technical details to the team, but using the header sounded less reliable (lees: houtje touwtje) than FKs. |
👍 I understand that, I'm afraid it's the only option though. Since e-mail is actually sent in application code through |
[#3402] Add support for logging status changes in yubin emails
…-headers-for-registration-email [#3402] Add extra headers to email registration
Related to #3326
Currently emails are delivered asynchronously - this applies to all transactional emails (registration backend, confirmation email...) using django-yubin. This causes the logs for a submission to report a success status because the email was queued successfully.
However, the actual sending/delivery can fail for a multitude of reasons (not limited to just attachment size) and we cannot correlate that back to the submission now.
Ideally, we can attach metadata to the email to be able to correlate it to the record/instance that caused it to be sent so that we can update the relevant logs/audit trails.
E.g. using custom headers for the e-mail:
X-OF-Content-Type: submissions.submission
X-OF-Content-UUID: c2e1c102-34c5-4f67-b207-02484454b92b
X-OF-event: registration-email
We can then periodically (using Celery?) process the mail queue and create
TimelineLog
records for the statuses/events like succesful delivery or failed delivery. This then also allows us to create digest e-mails to send to the people that have to deal with these issues.Technical specification
X-OF-Content-Type: submission.submission
X-OF-Content-UUID: <uuid of the submission>
X-OF-Event: registration
post_save
to record every (re)-send attemptPlease break up the tasks into separate, small, easy to review PRs!
The text was updated successfully, but these errors were encountered: