reactjs - 编辑在确认电子邮件 dj_rest_auth 中发送的 url
问题描述
当我注册一个新用户时,电子邮件模板中发送的确认电子邮件包含后端的 url,但我需要在 forntend 中处理它。有人知道如何编辑 jazzband 的 dj_rest_auth 电子邮件模板吗?
电子邮件模板是:
来自example.com的您好!
您收到这封电子邮件是因为用户 Pinon 提供了您的电子邮件地址来连接他们的帐户。
要确认这是正确的,请转到 http://localhost:8000/auth/registration/account-confirm-email/Nw:1kO3gI:PQDfxEOyklUYIxpjNN_011ZxGQYPJRdNomzzOFjtXA0/
来自example.com的感谢!例子.com
但我需要它是这样的:
来自example.com的您好!
您收到这封电子邮件是因为用户 Pinon 提供了您的电子邮件地址来连接他们的帐户。
要确认这是正确的,请转到 http://localhost:3000/account-confirm-email/Nw:1kO3gI:PQDfxEOyklUYIxpjNN_011ZxGQYPJRdNomzzOFjtXA0/
来自example.com的感谢!例子.com
解决方案
好的,这个东西是由 django_allauth 包处理的。因此,您必须按照他们在 (django_allauth)文档中的建议进行操作
所以我创建了这样的目录:templates/account/email/email_confirmation_message.txt 然后将此代码添加到文件中:
{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}!
You're receiving this e-mail because user {{ user_display }} has given your e-mail address to register an account on {{ site_domain }}.
To confirm this is correct, <a href="http://localhost:3000/auth/account/confirm/email/{{ key }}" target="_blank">Click here.</a>
{% endblocktrans %}
{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you from {{ site_name }}!
{{ site_domain }}{% endblocktrans %}
{% endautoescape %}
那
{{ 钥匙 }}
是主要的事情要找到。
推荐阅读
- c - 如何为 GCC 运行链接描述文件
- linux - Pulseaudio 设置/检查默认源
- c++ - 在 C++ 中,ifstream 在一行中什么也不读取
- ios - 从公共 API 获取 JSON 以在 SwiftUI 的列表视图中呈现
- python - 如何在 OpenCV Python 中识别图像中的不同对象
- bash - 截断/删除通过输出重定向生成的日志文件内容“>”
- c++ - Xcode:包含额外的 .h 和 .c 文件,用于链接代码
- angular - 部署在 S3 上的 Angular 2+ 应用程序会出现路由问题
- javascript - Gridsome 构建失败并出现 TypeError
- c# - 坏设备令牌苹果推送通知