add email setting, closes #5. other misc small fixes
This commit is contained in:
parent
135bd95a6a
commit
86b061c971
11 changed files with 85 additions and 99 deletions
|
|
@ -139,6 +139,9 @@ def trade_acceptance_email_notification(sender, instance, created, **kwargs):
|
|||
else:
|
||||
return
|
||||
|
||||
if not recipient_user.enable_email_notifications:
|
||||
return
|
||||
|
||||
is_initiator = instance.trade_offer.initiated_by.user.pk == acting_user.pk
|
||||
|
||||
email_context = {
|
||||
|
|
@ -159,8 +162,6 @@ def trade_acceptance_email_notification(sender, instance, created, **kwargs):
|
|||
email_subject += render_to_string("email/trades/trade_update_" + state + "_subject.txt", email_context)
|
||||
email_body = render_to_string(email_template, email_context)
|
||||
|
||||
print("initiated by: ", instance.trade_offer.initiated_by, ", accepted by: ", instance.accepted_by, ", acting user: ", acting_user, ", recipient user: ", recipient_user, ", state: ", state)
|
||||
|
||||
send_mail(
|
||||
email_subject,
|
||||
email_body,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue