Merge branch 'sales_features' into 'dev'

finance email

See merge request !289
remotes/origin/yandex_rebiling
Andrey 8 years ago
commit 5e8b6a8c1b
  1. 7
      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")

Loading…
Cancel
Save