This commit is contained in:
Aarni Halinen
2020-07-16 01:36:02 +03:00
parent 5c4e4c7f5a
commit 0adca6bd2e
10 changed files with 55 additions and 32 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ import logging
from smtplib import SMTPAuthenticationError
from members.models import Member, Request
from members.views.utils import send_mail_wrapper
from webapp.utils import send_email
@receiver(post_save, sender=Request)
@@ -24,7 +24,7 @@ def email_on_request(sender, instance, created, **kwargs):
if created:
subject = 'Test1'
message = 'Please validate your email address\r\n'
send_mail_wrapper(subject, message, instance.email)
send_email(instance.email, subject, message)
except SMTPAuthenticationError:
logging.error('Failed to send email to accepted request!')
@@ -39,6 +39,6 @@ def email_on_accept(sender, instance, created, **kwargs):
if created:
subject = 'Test2'
message = 'Jäsenhakemuksesi on hyväksytty!!!\r\n'
send_mail_wrapper(subject, message, instance.email)
send_email(instance.email, subject, message)
except SMTPAuthenticationError:
logging.error('Failed to send email to accepted member!')