From 6f711d1ffd4848c8cf469551d6fefcc7e23c94f0 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 28 Mar 2018 12:36:06 +0300 Subject: [PATCH] finance email --- finance/views.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/finance/views.py b/finance/views.py index 6aaac01..3592119 100644 --- a/finance/views.py +++ b/finance/views.py @@ -160,9 +160,6 @@ class InvoiceDetailView(APIView): ) invoice.yandex_pay = yandex_pay - html = render_to_string('mail/sales/back_set_bill.html', {'varname': 'value'}) # render with dynamic value - plaintext = strip_tags(html) - context = { 'user_email': invoice.bill.user.email, 'opener_full_name': invoice.bill.opener.get_full_name(), @@ -173,8 +170,8 @@ class InvoiceDetailView(APIView): subject, to = 'Выставлен новый счёт', invoice.bill.opener.email - text_content = plaintext.render(context) - html_content = html.render(context) + html_content = render_to_string('mail/sales/back_set_bill.html', context) + text_content = strip_tags(html_content) msg = EmailMultiAlternatives(subject, text_content, to=[to], bcc=['dmitry.dolya@skillbox.ru']) msg.attach_alternative(html_content, "text/html")