I want to sent the link to the email so when user clicks that link, the user will be redirected to the refer page and can refer other friends. I have used send_mail to send the email. Everything gets sent except the html message. Here is what i have done
if created:
new_join_old.invite_code = get_invite_code()
new_join_old.save()
subject = "Thank you for your request to sign up our community"
html_message = '<a href="http://localhost:8000/{% url "invitations:refer-invitation" invite_code %}">Click Here</a>'
message = "Welcome! We will be in contact with you."
from_email = None
to_email = [email]
send_mail(subject, message, from_email, to_email, fail_silently=True, html_message=html_message)
messages.success(request, '{0} has been invited'.format(email))
return HttpResponseRedirect("/invitations/refer-invitation/%s"%(new_join_old.invite_code))
context = {"form": form}
return render(request, 'home.html', context)