Skip to content

Commit

Permalink
Emails templates/free plan (#103)
Browse files Browse the repository at this point in the history
* changed card email added

* add free-plan send email
  • Loading branch information
BarbosaJackson committed Dec 16, 2021
1 parent 8aca8e0 commit 2611d2b
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{% extends 'authentication/emails/base.html' %}
{% load static i18n %}

{% block main-content %}
<section style="width: 574px; margin: 48px">
<div
style="
font-family: 'Lato', sans-serif;
font-style: normal;
font-weight: normal;
font-size: 20px;
line-height: 28px;
color: #808080;
"
>
{% trans "Hi" %},
<span
style="
font-family: 'Lato', sans-serif;
color: #262626;
font-size: 20px;
font-weight: bold;
line-height: 28px;
font-style: normal;
"
>{{ user_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 "Your " %} {{ org_name }} {% trans "organization has the Free Plan" %}
<span style="margin-left: 2px">
<img style="max-height: 20px" src="./emojis/rocket.png" alt="" />
</span>
</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 " %} <strong>{% trans "Free Plan " %}</strong>{% trans "was chosen for your organization" %}.
{% trans "The members can now take advantage of the benefits and scale their communication with our tools" %}
<span style="margin-left: 1px">
<img
style="max-height: 16px"
src="./emojis/blue-heart.png"
alt=""
/>
</span>
</div>
</section>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% load i18n %}
<p>{% trans "Hi" %}, {{user_name}} </p>
<p>{% trans "Your " %} {{ org_name }} {% trans "organization has the Free Plan" %}</p>
<p>
{% trans "The " %} <strong>{% trans "Free Plan " %}</strong>{% trans "was chosen for your organization" %}.
{% trans "The members can now take advantage of the benefits and scale their communication with our tools" %}
</p>
16 changes: 16 additions & 0 deletions connect/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,22 @@ def send_email_removed_credit_card(self, user_name: str, email: str):
html_message=render_to_string("billing/emails/removed-card.html", context)
)

def send_email_free_plan(self, user_name: str, email: str):
if not settings.SEND_EMAILS:
return False
context = {
"base_url": settings.BASE_URL,
"user_name": user_name,
"org_name": self.organization.name
}
send_mail(
_(f"Your {self.organization.name} organization has the Free Plan"),
render_to_string("authentication/emails/free_plan.txt"),
None,
[email],
html_message=render_to_string("authentication/emails/free_plan.html", context)
)


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

0 comments on commit 2611d2b

Please sign in to comment.