@@ -509,6 +509,9 @@ def send_mail_wrapper(subject, message, email_to):
|
||||
|
||||
@receiver(post_save, sender=Request)
|
||||
def email_on_request(sender, instance, created, **kwargs):
|
||||
if not settings.ENABLE_AUTOMATIC_EMAILS:
|
||||
return
|
||||
|
||||
try:
|
||||
if created:
|
||||
subject = 'Test1'
|
||||
@@ -520,6 +523,9 @@ def email_on_request(sender, instance, created, **kwargs):
|
||||
|
||||
@receiver(post_save, sender=Member)
|
||||
def email_on_accept(sender, instance, created, **kwargs):
|
||||
if not settings.ENABLE_AUTOMATIC_EMAILS:
|
||||
return
|
||||
|
||||
try:
|
||||
if created:
|
||||
subject = 'Test2'
|
||||
|
||||
@@ -158,7 +158,7 @@ EMAIL_PORT = 587
|
||||
EMAIL_HOST_USER = '<gmailtunnarisi>@gmail.com'
|
||||
EMAIL_HOST_PASSWORD = '<gmail_passu>'
|
||||
DEFAULT_EMAIL_FROM = 'SIK Viestintä <sikviestinta@gmail.com>'
|
||||
|
||||
ENABLE_AUTOMATIC_EMAILS = False
|
||||
|
||||
# ReCaptcha
|
||||
# http://www.yaconiello.com/blog/integrating-google-recaptcha-to-django/
|
||||
|
||||
Reference in New Issue
Block a user