Merge branch 'sales_features' into 'dev'

finance email

See merge request !288
remotes/origin/yandex_rebiling
Andrey 8 years ago
commit b9871d417a
  1. 7
      finance/views.py
  2. 6
      templates/mail/sales/back_set_bill.txt

@ -14,7 +14,8 @@ from rest_framework.views import APIView
from yandex_money.models import Payment from yandex_money.models import Payment
from django.conf import settings from django.conf import settings
from django.core.mail import EmailMultiAlternatives from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template from django.template.loader import render_to_string
from django.utils.html import strip_tags
from courses.models import Course from courses.models import Course
from courses.api import CourseParamsApi from courses.api import CourseParamsApi
@ -159,8 +160,8 @@ class InvoiceDetailView(APIView):
) )
invoice.yandex_pay = yandex_pay invoice.yandex_pay = yandex_pay
plaintext = get_template('mail/sales/back_set_bill.txt') html = render_to_string('mail/sales/back_set_bill.html', {'varname': 'value'}) # render with dynamic value
html = get_template('mail/sales/back_set_bill.txt') plaintext = strip_tags(html)
context = { context = {
'user_email': invoice.bill.user.email, 'user_email': invoice.bill.user.email,

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