Skip to content

Commit

Permalink
fix project delete template
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisoSouza committed Dec 16, 2021
1 parent 903adc9 commit 4ce182c
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{% extends 'authentication/emails/base.html' %}
{% load static i18n %}

{% block main-content %}
<section style="width: 574px; margin: 50px auto">
<div
style="
font-family: 'Lato', sans-serif;
font-style: normal;
font-weight: normal;
font-size: 20px;
line-height: 24px;
color: #808080;
"
>
{% trans 'Hi,' %}
<span
style="
font-family: 'Lato', sans-serif;
color: #262626;
font-size: 20px;
font-weight: bold;
font-style: normal;
"
>{{ first_name }}!</span
>
</div>

<div
style="
font-family: 'Lato', sans-serif;
font-weight: bold;
font-size: 20px;
line-height: 28px;
color: #262626;
margin-top: 24px;
"
>
{% trans 'A project was deleted' %}...
</div>

<div
style="
font-family: 'Lato', sans-serif;
font-style: normal;
font-weight: normal;
font-size: 16px;
line-height: 24px;
color: #808080;
margin-top: 24px;
"
>
{% trans 'The project' %} <strong>{{ project_name }}</strong> {% trans 'was deleted from the organization' %}
<strong>{{organization_name}}<strong>, {% trans "we hope that it has built everything it wanted and that our intelligences did a good job" %}
</div>
</section>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% load i18n %}
<p>{% trans 'Hi' %} {{first_name}}</p>
<p>{% trans 'A project was deleted' %}...</p>
<p>{% trans 'The project' %} {{ project_name }} {% trans 'was deleted from the organization' %}
{{organization_name}}, {% trans "we hope that it has built everything it wanted and that our intelligences did a good job" %}.
</p>
19 changes: 19 additions & 0 deletions connect/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,25 @@ def send_email_create_project(self, first_name: str, email: str):
),
)

def send_email_deleted_project(self, first_name: str, email: str):
if not settings.SEND_EMAILS:
return False # pragma: no cover
context = {
"base_url": settings.BASE_URL,
"organization_name": self.organization.name,
"project_name": self.name,
"first_name": first_name,
}
send_mail(
_("A project was deleted..."),
render_to_string("authentication/emails/project_delete.txt"),
None,
[email],
html_message=render_to_string(
"authentication/emails/project_delete.html", context
),
)


class Service(models.Model):
class Meta:
Expand Down

0 comments on commit 4ce182c

Please sign in to comment.