Merge branch 'sales_features' into 'dev'

finance email

See merge request !290
master
Andrey 8 years ago
commit cb019e9bb7
  1. 25
      finance/views.py
  2. 7
      templates/mail/sales/pay_access.html

@ -409,15 +409,22 @@ class YandexAvisoView(APIView):
'response': xml_res, 'response': xml_res,
}) })
msg = EmailMessage( context = {
'Успешная оплата.', 'user_email': pay.invoice.bill.user.email,
'''Пользователь "%s", перевёл %s рублей. Номер платежа в яндекс кассе %s''' 'opener_full_name': pay.invoice.bill.opener.get_full_name(),
% (pay.invoice.bill.user.email, str(pay.invoice.price), str(data['invoiceId'])), 'course_title': Course.objects.get(token=pay.invoice.bill.course_token).title,
'robo@skillbox.ru', 'date': str(pay.invoice.date),
[pay.invoice.bill.opener.email], 'price': pay.invoice.price,
bcc=['dmitry.dolya@skillbox.ru', 'vera.procenko@skillbox.ru'], 'finish_date': pay.performed_datetime,
) }
subject, to = 'Выставлен новый счёт', pay.invoice.bill.opener.email
html_content = render_to_string('mail/sales/pay_access.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")
msg.send() msg.send()
return HttpResponse(xml_res, content_type='application/xml') return HttpResponse(xml_res, content_type='application/xml')

@ -0,0 +1,7 @@
<div> Выставлен новый счет </div>
<div> Пользователь: {{ user_email }} </div>
<div> Продавец: {{ opener_full_name }} </div>
<div> Курс: {{ course_title }} </div>
<div> Дата продажи: {{ date }} </div>
<div> Дата оплаты: {{ finish_date }} </div>
<div> Сумма: {{ price }} руб. </div>
Loading…
Cancel
Save