From 432f52255d5564f1cbf1a53f8b9a028587c4cfdc Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 28 Mar 2018 08:29:36 +0300 Subject: [PATCH] finance email --- finance/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/finance/views.py b/finance/views.py index 677af39..5ca318b 100644 --- a/finance/views.py +++ b/finance/views.py @@ -15,7 +15,6 @@ from yandex_money.models import Payment from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template -from django.template import Context from courses.models import Course from courses.api import CourseParamsApi @@ -160,20 +159,20 @@ class InvoiceDetailView(APIView): plaintext = get_template('mail/sales/back_set_bill.txt') html = get_template('mail/sales/back_set_bill.txt') - context = Context({ + context = { 'user_email': invoice.bill.user.email, 'opener_full_name': invoice.bill.opener.get_full_name(), 'course_title': Course.objects.get(token=invoice.bill.course_token).title, 'date': str(invoice.date), 'price': invoice.price, - }) + } subject, from_email, to = 'Выставлен новый счёт', 'robo@skillbox.ru', 'invoice.bill.opener.email' text_content = plaintext.render(context) html_content = html.render(context) - msg = EmailMultiAlternatives(subject, text_content, from_email, [to]) + msg = EmailMultiAlternatives(subject, text_content, from_email, [to], bcc=['dmitry.dolya@skillbox.ru'],) msg.attach_alternative(html_content, "text/html") msg.send()