Django sending emails with links
问题 I have a sending code: def send_email(site_id, email): subject = "Sub" from_email, to = EMAIL_FROM, email text_content = 'Text' html_content = render_to_string( 'app/includes/email.html', {'pk': site_id} ) msg = EmailMultiAlternatives(subject, text_content, from_email, [to]) msg.attach_alternative(html_content, "text/html") msg.send() And in my template <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>title</title> </head> <body> <a href="{% url 'mail_view' pk %}">Click<