Яндекс деньги

feature/fix_generate_pass
Andrey 8 years ago
parent 7a18cb30ae
commit 0cdc8515f4
  1. 16
      finance/signals.py

@ -12,7 +12,7 @@ def delete_dependencies(instance, **kwargs):
"""Отправка сообщения после сохранения платежа"""
if instance.yandex_pay and instance.method == 'Y' and instance.status == 'P':
msg = EmailMessage(
'Вам выставлен новый счёт!',
'Вам выставлен новый счёт',
'''Вам выставлен счёт, для оплаты перейдите по ссылке
https://go.skillbox.ru/api/v1/finance/payment/%s/''' % instance.yandex_pay.id,
'robo@skillbox.ru',
@ -20,7 +20,7 @@ def delete_dependencies(instance, **kwargs):
[instance.bill.opener.email],
reply_to=[instance.bill.opener.email],
)
msg.message()
msg.send()
if instance.status == 'F':
if instance.is_open:
@ -30,13 +30,13 @@ def delete_dependencies(instance, **kwargs):
active_obj=instance.bill.course.get_first(['tutorial', 'task',])
)
msg = EmailMessage(
'Ваш платёж прошёл успешно!',
'Ваш платёж прошёл успешно',
'''Вам открыт доступ к курсу "%s", вы можете перейти по ссылке и
ознакомиться с материабламиhttps://go.skillbox.ru/course/%s/'''
% (instance.bill.course.title, instance.bill.course.slug),
'robo@skillbox.ru',
[instance.yandex_pay.cps_email],
[instance.bill.opener.email],
cc=[instance.bill.opener.email],
reply_to=[instance.bill.opener.email],
)
else:
@ -45,10 +45,10 @@ def delete_dependencies(instance, **kwargs):
'''Курс "%s" был забронирован''' % instance.bill.course.title,
'robo@skillbox.ru',
[instance.yandex_pay.cps_email],
[instance.bill.opener.email],
cc=[instance.bill.opener.email],
reply_to=[instance.bill.opener.email],
)
msg.message()
msg.send()
if instance.status == 'C':
msg = EmailMessage(
@ -60,10 +60,10 @@ def delete_dependencies(instance, **kwargs):
которую превела к ошибке"""
% (instance.bill.user.get_full_name(), instance.bill.course.title, instance.id),
'robo@skillbox.ru',
[instance.bill.opener.email],
cc=[instance.bill.opener.email],
reply_to=["andrey.korolev@skillbox.ru"]
)
msg.message()
msg.send()
@receiver(post_save, sender=Payment)

Loading…
Cancel
Save