mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-04-27 18:21:23 +08:00
Add email template for request status update, fix admin view for request unit view, and add initial app for questionnaires
This commit is contained in:
parent
ba19412d31
commit
8bd8df9042
15 changed files with 79 additions and 7 deletions
0
docmanager_backend/emails/__init__.py
Normal file
0
docmanager_backend/emails/__init__.py
Normal file
6
docmanager_backend/emails/apps.py
Normal file
6
docmanager_backend/emails/apps.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class EmailsConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "emails"
|
0
docmanager_backend/emails/migrations/__init__.py
Normal file
0
docmanager_backend/emails/migrations/__init__.py
Normal file
13
docmanager_backend/emails/templates.py
Normal file
13
docmanager_backend/emails/templates.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from djoser import email
|
||||
from config.settings import FRONTEND_URL
|
||||
|
||||
|
||||
class RequestUpdateEmail(email.BaseEmailMessage):
|
||||
template_name = "request_approved.html"
|
||||
|
||||
def get_context_data(self):
|
||||
context = super().get_context_data()
|
||||
context["request_status"] = context.get("request_status")
|
||||
context["url"] = FRONTEND_URL
|
||||
context.update(self.context)
|
||||
return context
|
25
docmanager_backend/emails/templates/request_approved.html
Normal file
25
docmanager_backend/emails/templates/request_approved.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block subject %}
|
||||
{% blocktrans %}USTP - Document Request Form Update{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block text_body %}
|
||||
{% blocktrans %}You're receiving this email because your document request has been {{ request_status }}.{% endblocktrans %}
|
||||
|
||||
{% trans 'Please visit the site to check your request:' %}
|
||||
{{ url|safe }}
|
||||
{% endblock %}
|
||||
|
||||
{% block html_body %}
|
||||
<p>
|
||||
{% blocktrans %}You're receiving this email because your document request has been {{ request_status }}.{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% trans 'Please visit the site to check your request:' %}
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{ url|safe }}"></a>
|
||||
</p>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue