I’m using a third party to send email, and they allow me to categorize my email by adding headers to the emails i send through them.
Is it possible to either add a header to the exception email before it gets sent? Or at least, I’ll managing sending the email by catching the exception in the middleware, but how do I generate the nice email response django sends me on a 500?
EDIT: I know how to add headers to emails, I know how to process exception through middleware. I am interested in how to generate the same email that django sends on exception, so that i can add a header.
Here is how
AdminEmailHandlerworks:For reference only: my previous answer.
process_response)Here is an example: