Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env_sample
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SELENIUM_HOSTNAME=selenium
#EMAIL_HOST_PASSWORD=pass
#EMAIL_PORT=587
#EMAIL_USE_TLS=True
#DEFAULT_FROM_EMAIL="Codabench <noreply@example.com>"
#SERVER_EMAIL=noreply@example.com

# Contact Email
Expand Down
2 changes: 1 addition & 1 deletion src/apps/forums/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def send_mail(context=None, from_email=None, html_file=None, text_file=None, sub
:param subject: Email's subject.
:param to_email: Recipient's email.
"""
from_email = from_email if from_email else settings.SERVER_EMAIL
from_email = from_email if from_email else settings.DEFAULT_FROM_EMAIL

context["site"] = Site.objects.get_current()

Expand Down
2 changes: 1 addition & 1 deletion src/apps/profiles/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def send_mail(context=None, from_email=None, html_file=None, text_file=None, sub
:param subject: Email's subject.
:param to_email: Recipient's email.
"""
from_email = from_email if from_email else settings.SERVER_EMAIL
from_email = from_email if from_email else settings.DEFAULT_FROM_EMAIL

context["site"] = Site.objects.get_current()

Expand Down
1 change: 1 addition & 0 deletions src/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ def setup_celery_logging(**kwargs):
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_PORT = os.environ.get('EMAIL_PORT', 587)
EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', True)
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', 'Codabench <noreply@codabench.org>')
SERVER_EMAIL = os.environ.get('SERVER_EMAIL', 'noreply@codabench.org')

CONTACT_EMAIL = os.environ.get('CONTACT_EMAIL', 'info@codabench.org')
Expand Down
4 changes: 2 additions & 2 deletions src/utils/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def codalab_send_mail(context_data, to_email, html_file, text_file, subject, from_email=None):
from_email = from_email if from_email else settings.SERVER_EMAIL
from_email = from_email if from_email else settings.DEFAULT_FROM_EMAIL

context_data["site"] = Site.objects.get_current()

Expand Down Expand Up @@ -40,7 +40,7 @@ def sanitize(content):


def codalab_send_markdown_email(subject, markdown_content, recipient_list, from_email=None):
from_email = from_email if from_email else settings.SERVER_EMAIL
from_email = from_email if from_email else settings.DEFAULT_FROM_EMAIL
html_message = markdown.markdown(markdown_content)
# message = sanitize(markdown_content)
# html_message = sanitize(markdown.markdown(message))
Expand Down