Note that there are some explanatory texts on larger screens.

plurals
  1. POsending email templates in with django
    primarykey
    data
    text
    <p>I want to send an email with a template like this.</p> <pre><code>{% extends "base.html" %} {% block content %} &lt;h2&gt;Invoice Details&lt;/h2&gt; &lt;div id="horizontalnav"&gt; &lt;a href="/index/add_invoice"&gt;Add an Invoice&lt;/a&gt; &lt;a href="/index/work_orders"&gt;Add a Work Order&lt;/a&gt; &lt;a href="/index/add_payment"&gt;Add Payment&lt;/a&gt; &lt;/div&gt; &lt;ul STYLE="border: 1px solid;float:left;padding:15px; width: 700px;"&gt; &lt;h2 STYLE="text-align: right; COLOR:blue; Font-family:ARIAL"&gt; INVOICE&lt;/h2&gt; &lt;br/&gt; &lt;b&gt;company&lt;/b&gt; &lt;br/&gt; &lt;div id="list"&gt; {% for invoice in invoices_list %} &lt;p style="text-align: right;"&gt;INVOICE # {{invoice.invoice_no}}&lt;br/&gt; {{invoice.date}}&lt;br/&gt; {{invoice.contract_info}}&lt;br/&gt; {% for invoice in invoice.work_orders.all %} {{invoice}}&lt;br/&gt; {% endfor %} {% endfor %} &lt;p style="text-align: left"&gt; &lt;p&gt;To&lt;/p&gt; {{client.company}}&lt;br/&gt; {{client.address}}&lt;br/&gt; {{client.city}}&lt;br/&gt; {{client.postcode}}&lt;br/&gt; &lt;p&gt; &lt;/div&gt; &lt;/ul&gt; {% endblock %} </code></pre> <p>I want to send fully html powered templates, with django datas. However I am having some problems. I am getting this error.</p> <pre><code>"to" argument must be a list or tuple </code></pre> <p>I am assuming there might be a problem with my views with the send to email domain, but there should not be a problem with this. I somehow am getting stuck with this.</p> <pre><code>#views.py @login_required def invoice_mail(request): t = loader.get_template('registration/email.txt') c = Context({ 'invoices_list': 'invoices_list', 'clients_list': 'clients_list', }) send_mail('Welcome to My Project', t.render(c), 'joe@example.com', '[tom@example.com]', fail_silently=False) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload