[#32488017] merge conflicts
commit
15ea12534a
|
@ -7,6 +7,7 @@ logger = logging.getLogger(__name__)
|
||||||
from celery.task import task
|
from celery.task import task
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from regluit.core import bookloader, models
|
from regluit.core import bookloader, models
|
||||||
from regluit.core import goodreads, librarything
|
from regluit.core import goodreads, librarything
|
||||||
|
@ -60,10 +61,17 @@ def fac(n, sleep_interval=None):
|
||||||
@task
|
@task
|
||||||
def send_mail_task(subject, message, from_email, recipient_list,
|
def send_mail_task(subject, message, from_email, recipient_list,
|
||||||
fail_silently=False, auth_user=None, auth_password=None,
|
fail_silently=False, auth_user=None, auth_password=None,
|
||||||
connection=None):
|
connection=None, override_from_email=True):
|
||||||
"""a task to drop django.core.mail.send_mail into """
|
"""a task to drop django.core.mail.send_mail into """
|
||||||
try:
|
# NOTE: since we are currently using Amazon SES, which allows email to be sent only from validated email
|
||||||
r=send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=auth_user,
|
# addresses, we force from_email to be one of the validated address unless override_from_email is FALSE
|
||||||
|
try:"
|
||||||
|
if override_from_email:
|
||||||
|
try:
|
||||||
|
from_email = settings.DEFAULT_FROM_EMAIL
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
r= send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=auth_user,
|
||||||
auth_password=auth_password, connection=connection)
|
auth_password=auth_password, connection=connection)
|
||||||
except:
|
except:
|
||||||
r=logger.info('failed to send message:' + message)
|
r=logger.info('failed to send message:' + message)
|
||||||
|
|
|
@ -172,7 +172,8 @@ LOGGING = {
|
||||||
|
|
||||||
# django-registration
|
# django-registration
|
||||||
EMAIL_HOST = 'smtp.gluejar.com'
|
EMAIL_HOST = 'smtp.gluejar.com'
|
||||||
DEFAULT_FROM_EMAIL = 'info@gluejar.com'
|
DEFAULT_FROM_EMAIL = 'notices@gluejar.com'
|
||||||
|
SERVER_EMAIL = 'notices@gluejar.com'
|
||||||
ACCOUNT_ACTIVATION_DAYS = 30
|
ACCOUNT_ACTIVATION_DAYS = 30
|
||||||
|
|
||||||
# django-socialauth
|
# django-socialauth
|
||||||
|
|
Loading…
Reference in New Issue