-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #971 from DDMAL/jacky/enable-email-notifications
- Loading branch information
Showing
15 changed files
with
183 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from djoser import email | ||
|
||
class PasswordChangedConfirmationEmail(email.PasswordChangedConfirmationEmail): | ||
template_name = "emails/password_changed_confirmation.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,19 +239,28 @@ | |
############################################################################### | ||
# A sample email configuration. These parameters are used to send emails to | ||
# the owner of WorkflowRuns, etc. | ||
# To enable emailing, fill out email parameters below and set EMAIL_USE to True. | ||
# See https://docs.djangoproject.com/en/1.10/topics/email/ for | ||
# more details on how to customize your email configuration. | ||
# SMTP credentials should be set as environment variables. If they are not set, | ||
# emails will be printed to the console instead. | ||
|
||
# [TODO] - Setup proper email configuration. | ||
EMAIL_USE = True | ||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" if os.getenv("EMAIL_HOST") else "django.core.mail.backends.console.EmailBackend" | ||
EMAIL_HOST = os.getenv("EMAIL_HOST") | ||
EMAIL_PORT = os.getenv("EMAIL_PORT") | ||
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER") | ||
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD") | ||
EMAIL_USE_TLS = True | ||
|
||
EMAIL_USE = False | ||
# EMAIL_USE_TLS = True | ||
# EMAIL_HOST = 'smtp.gmail.com' | ||
# EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER') | ||
# EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASS') | ||
# EMAIL_PORT = 587 | ||
DEFAULT_FROM_EMAIL = "Rodan <[email protected]>" | ||
|
||
SITE_NAME = "Rodan" | ||
|
||
DJOSER = { | ||
"PASSWORD_CHANGED_EMAIL_CONFIRMATION": True, | ||
"EMAIL": { | ||
"password_changed_confirmation": "rodan.email.PasswordChangedConfirmationEmail", | ||
} | ||
|
||
} | ||
|
||
############################################################################### | ||
# 2.a Rodan Server Configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% load i18n %} | ||
|
||
{% block subject %} | ||
{% blocktrans %}{{ site_name }} - You have been added to project '{{ project_name }}'!{% endblocktrans %} | ||
{% endblock %} | ||
|
||
{% block html_body %} | ||
<p>{% blocktrans %}You have been added as '{{ role }}' to project '{{ project_name }}' by '{{ adder }}'!{% endblocktrans %}</p> | ||
{% endblock html_body %} |
9 changes: 9 additions & 0 deletions
9
rodan-main/code/rodan/templates/emails/password_changed_confirmation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% load i18n %} | ||
|
||
{% block subject %} | ||
{% blocktrans %}{{ site_name }} - Your password has been successfully changed!{% endblocktrans %} | ||
{% endblock %} | ||
|
||
{% block html_body %} | ||
<p>{% trans "Your password has been changed!" %}</p> | ||
{% endblock html_body %} |
19 changes: 19 additions & 0 deletions
19
rodan-main/code/rodan/templates/emails/workflow_run_failed.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% load i18n %} | ||
|
||
{% block subject %} | ||
{% blocktrans %}{{ site_name }} - Workflow run '{{ name }}'' failed{% endblocktrans %} | ||
{% endblock %} | ||
|
||
{% block html_body %} | ||
<p>{% trans "A workflow run you started has failed." %}</p> | ||
<table> | ||
<tr> | ||
<th>{% trans "Name" %}</th> | ||
<td>{{ name }}</td> | ||
</tr> | ||
<tr> | ||
<th>{% trans "Description" %}</th> | ||
<td>{{ description }}</td> | ||
</tr> | ||
</table> | ||
{% endblock html_body %} |
19 changes: 19 additions & 0 deletions
19
rodan-main/code/rodan/templates/emails/workflow_run_finished.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% load i18n %} | ||
|
||
{% block subject %} | ||
{% blocktrans %}{{ site_name }} - Workflow run '{{ name }}'' has finished!{% endblocktrans %} | ||
{% endblock %} | ||
|
||
{% block html_body %} | ||
<p>{% trans "A workflow run you started has finished!" %}</p> | ||
<table> | ||
<tr> | ||
<th>{% trans "Name" %}</th> | ||
<td>{{ name }}</td> | ||
</tr> | ||
<tr> | ||
<th>{% trans "Description" %}</th> | ||
<td>{{ description }}</td> | ||
</tr> | ||
</table> | ||
{% endblock html_body %} |
19 changes: 19 additions & 0 deletions
19
rodan-main/code/rodan/templates/emails/workflow_run_waiting_for_user_input.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% load i18n %} | ||
|
||
{% block subject %} | ||
{% blocktrans %}{{ site_name }} - Workflow run '{{ name }}'' is waiting for user input.{% endblocktrans %} | ||
{% endblock %} | ||
|
||
{% block html_body %} | ||
<p>{% trans "A workflow run you started is waiting for user input." %}</p> | ||
<table> | ||
<tr> | ||
<th>{% trans "Name" %}</th> | ||
<td>{{ name }}</td> | ||
</tr> | ||
<tr> | ||
<th>{% trans "Description" %}</th> | ||
<td>{{ description }}</td> | ||
</tr> | ||
</table> | ||
{% endblock html_body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters