django-rest-framework-passwordless
django-rest-framework-passwordless copied to clipboard
Add additional context to send_email_with_callback_token template and plaintext
Hi Aaronn,
Thank you for the great project.
I am interested in having the emailed token within a URL. This will mean a user will only have to click on the anchor, rather then copying and pasting the token. As the users email is also required for auth_token I have added this in the link.
a solution here should be generalizable to other use cases. your email link format for example, is unlikely to be usable by others.
another approach is to extend the context processing scaffold in inject_template_context
and actually invoke the processors with sufficient context (i.e. email) to be actionable. right now, nothing is provided to the processors, which limits their usefulness. once that is in place, you can leverage the context processor extension + override the email template to format any url that you need.
JWS, your suggestion is so much more elegant! I can't believe I didn't see the simpler solution of passing the user to the template. I will update accordingly.