LeoneBacciu / django-email-verification

A Django app that takes care of verifying a users's email address and activating their profile.
MIT License
353 stars 57 forks source link

Attached static files on Email #60

Closed wozniakos10 closed 2 years ago

wozniakos10 commented 2 years ago

Hi, thanks for create this awesome library. I have one question about this package. I tried to customize mail_body html and send to user a message with image which i have in static files on my project. I use it on that way:

img src="{% static 'msagh_website/images/agh.jpg' %}"

And mail comes to use without a image. When i use this syntax to display image on my site everything is ok. When instead of this syntax I just use url from random image on net, there is no problem.

LeoneBacciu commented 2 years ago

This is likely because the generated url is relative (e.g. /images/cat.png) instead of absolute (e.g. https://example.com/images/cat.png). You should manually add the domain name of the server where the image is stored, so that the email client can figure out where to take the image from.