Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test environment email backend setup #398

Merged
merged 1 commit into from
Aug 21, 2024
Merged
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
8 changes: 4 additions & 4 deletions competition/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
rank_results)
from personal.models import Profile, School
from personal.serializers import ProfileExportSerializer, SchoolSerializer
from webstrom.settings import EMAIL_ALERT, EMAIL_NO_REPLY
from webstrom.settings import EMAIL_ALERT

# pylint: disable=unused-argument

Expand Down Expand Up @@ -154,7 +154,7 @@ def publish(self, request, pk=None):
send_mail(
'Zverejnený komentár',
render_to_string('competition/emails/comment_published.txt'),
EMAIL_NO_REPLY,
None,
[comment.posted_by.email],
)

Expand All @@ -171,7 +171,7 @@ def hide(self, request, pk=None):
send_mail(
'Skrytý komentár',
render_to_string('competition/emails/comment_hidden.txt'),
EMAIL_NO_REPLY,
None,
[comment.posted_by.email],
)

Expand Down Expand Up @@ -231,7 +231,7 @@ def add_comment(self, request, pk=None):
send_mail(
'Nový komentár',
render_to_string('competition/emails/comment_added.txt'),
EMAIL_NO_REPLY,
None,
[EMAIL_ALERT],
)

Expand Down
4 changes: 2 additions & 2 deletions user/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from personal.models import Profile
from personal.serializers import ProfileCreateSerializer
from user.models import TokenModel
from webstrom.settings import EMAIL_ALERT, EMAIL_NO_REPLY
from webstrom.settings import EMAIL_ALERT


def reset_password_url_generator(request, user, temp_key):
Expand Down Expand Up @@ -172,7 +172,7 @@ def handle_other_school(self, school):
'school_info': school_info
},
),
EMAIL_NO_REPLY,
None,
[EMAIL_ALERT]
)

Expand Down
4 changes: 2 additions & 2 deletions webstrom/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

EMAIL_VERIFICATION_TIMEOUT = 86400

MANAGERS = [('Web', 'web@strom.sk'), ]
MANAGERS = [('Web', 'webmaster@strom.sk'), ]

EMAIL_NO_REPLY = 'no-reply@strom.sk' # z tade sa odosielaju maily
DEFAULT_FROM_EMAIL = 'noreply@strom.sk' # z tade sa odosielaju maily
EMAIL_ALERT = '[email protected]' # tu sa prijimaju maily
5 changes: 5 additions & 0 deletions webstrom/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@
}

EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"

EMAIL_HOST = "smtp-relay.gmail.com"
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_TIMEOUT = 10