finance email

remotes/origin/yandex_rebiling
Andrey 8 years ago
parent ff2e308aa4
commit 6f711d1ffd
  1. 7
      finance/views.py

@ -160,9 +160,6 @@ class InvoiceDetailView(APIView):
) )
invoice.yandex_pay = yandex_pay 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 = { context = {
'user_email': invoice.bill.user.email, 'user_email': invoice.bill.user.email,
'opener_full_name': invoice.bill.opener.get_full_name(), 'opener_full_name': invoice.bill.opener.get_full_name(),
@ -173,8 +170,8 @@ class InvoiceDetailView(APIView):
subject, to = 'Выставлен новый счёт', invoice.bill.opener.email subject, to = 'Выставлен новый счёт', invoice.bill.opener.email
text_content = plaintext.render(context) html_content = render_to_string('mail/sales/back_set_bill.html', context)
html_content = html.render(context) text_content = strip_tags(html_content)
msg = EmailMultiAlternatives(subject, text_content, to=[to], bcc=['dmitry.dolya@skillbox.ru']) msg = EmailMultiAlternatives(subject, text_content, to=[to], bcc=['dmitry.dolya@skillbox.ru'])
msg.attach_alternative(html_content, "text/html") msg.attach_alternative(html_content, "text/html")

Loading…
Cancel
Save