Django HTML E-mail template doesn't load css in the e-mail Django HTML E-mail template doesn't load css in the e-mail django django

Django HTML E-mail template doesn't load css in the e-mail


As other devs mentioned email clients do not load external css, so you have to inline it. Inlining css manually is poor decision. There are libraries to inline css. One of them is django-inlinecss. You can keep you code exactly as it is. All you need to do is to install django-inlinecss and to change "deposit_email.html". I do not know how it looks, because you have not publish it, so I give you example of simple header like email template I used before with success.

{% load inlinecss %}{% inlinecss "css/email.css" %}<!DOCTYPE html><html><head lang="en">  <meta charset="UTF-8">  <title>Title</title></head><body>  <table class="body">    <tr>      <td class="center" align="center" valign="top">        <center>          <table class="row header">            <tr>              <td class="center" align="center">                <center>                  <table class="container">                    <tr>                      <td class="wrapper last">                        <table class="twelve columns">                          <tr>                            <td>                              <img src="your_header_link">                            </td>                            <td class="expander"></td>                          </tr>                        </table>                      </td>                    </tr>                  </table>                </center>              </td>            </tr>          </table>          <table class="container">            <tr>              <td>                <table class="row">                  <tr>                    <td class="wrapper last">                      <table class="twelve columns">                        <tr>                          <td>                            {% block content %} Email {% endblock %}                            <td class="expander"></td>                        </tr>                      </table>                      </td>                  </tr>                </table>                </td>            </tr>          </table>        </center>        </td>    </tr>  </table></body></html>{% endinlinecss %}