Skip to content

Commit

Permalink
Fix certificate email not sent (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasciput authored May 31, 2022
1 parent fdef5c9 commit 092c98b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion django_project/certification/views/certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def email_all_attendees(request, **kwargs):
'{course_slug}/print/{pk}/\n\n'
'Sincerely,\n{convener_firstname} {convener_lastname}'
''.format(**data),
course.course_convener.user.email,
settings.DEFAULT_FROM_EMAIL,
[attendee.email],
fail_silently=False,
)
Expand Down
31 changes: 18 additions & 13 deletions django_project/core/settings/prod_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Configuration for production server."""
# noinspection PyUnresolvedReferences
from .prod import * # noqa
import ast
import os
print(os.environ)

Expand All @@ -28,16 +29,20 @@
}


# See fig.yml file for postfix container definition
#
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# Host for sending e-mail.
EMAIL_HOST = 'smtp'
# Port for sending e-mail.
EMAIL_PORT = 25
# SMTP authentication information for EMAIL_HOST.
# See fig.yml for where these are defined
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'docker'
EMAIL_USE_TLS = False
EMAIL_SUBJECT_PREFIX = '[PROJECTA]'
EMAIL_BACKEND = os.environ.get(
'EMAIL_BACKEND', 'django.core.mail.backends.smtp.EmailBackend')
EMAIL_HOST = os.environ.get(
'EMAIL_HOST', 'smtp')
EMAIL_HOST_USER = os.environ.get(
'EMAIL_HOST_USER', '[email protected]')
EMAIL_HOST_PASSWORD = os.environ.get(
'EMAIL_HOST_PASSWORD', 'docker')
EMAIL_PORT = os.environ.get(
'EMAIL_PORT', 'True')
EMAIL_SUBJECT_PREFIX = os.environ.get(
'EMAIL_SUBJECT_PREFIX', '[PROJECTA]')
EMAIL_USE_TLS = ast.literal_eval(os.environ.get(
'EMAIL_USE_TLS', 'True'))
EMAIL_USE_SSL = ast.literal_eval(os.environ.get(
'EMAIL_USE_SSL', 'False'))

0 comments on commit 092c98b

Please sign in to comment.