✨(teams) update and enhance team invitation email
- replace logo - modify wording - enhance template
This commit is contained in:
@@ -10,6 +10,7 @@ and this project adheres to
|
||||
|
||||
### Added
|
||||
|
||||
- ✨(teams) update and enhance team invitation email
|
||||
- ✨(api) define dimail timeout as a setting
|
||||
- ✨(frontend) feature modal add new access role to domain
|
||||
- ✨(api) allow invitations for domain management #708
|
||||
|
||||
@@ -1000,6 +1000,21 @@ class Invitation(BaseInvitation):
|
||||
def __str__(self):
|
||||
return f"{self.email} invited to {self.team}"
|
||||
|
||||
def _get_mail_subject(self):
|
||||
"""Get the subject of the team invitation."""
|
||||
role = self.get_role_display().lower()
|
||||
return gettext(
|
||||
f"[La Suite] You have been invited to become a {role} of a group"
|
||||
)
|
||||
|
||||
def _get_mail_context(self):
|
||||
"""Get the template variables for the invitation."""
|
||||
return {
|
||||
**super()._get_mail_context(),
|
||||
"team": self.team.name,
|
||||
"role": self.get_role_display().lower(),
|
||||
}
|
||||
|
||||
def get_abilities(self, user):
|
||||
"""Compute and return abilities for a given user."""
|
||||
can_delete = False
|
||||
|
||||
@@ -241,15 +241,14 @@ def test_models_team_invitations_get_abilities_member():
|
||||
def test_models_team_invitations_email():
|
||||
"""Check email invitation during invitation creation."""
|
||||
|
||||
member_access = factories.TeamAccessFactory(role="member")
|
||||
team = member_access.team
|
||||
team = factories.TeamFactory()
|
||||
|
||||
# pylint: disable-next=no-member
|
||||
assert len(mail.outbox) == 0
|
||||
|
||||
factories.TeamAccessFactory(team=team)
|
||||
# Please add test for french language after translations update
|
||||
invitation = factories.InvitationFactory(
|
||||
team=team, email="john@people.com", issuer__language="fr-fr"
|
||||
role="member", team=team, email="john@people.com", issuer__language="en-us"
|
||||
)
|
||||
|
||||
# pylint: disable-next=no-member
|
||||
@@ -259,10 +258,16 @@ def test_models_team_invitations_email():
|
||||
email = mail.outbox[0]
|
||||
|
||||
assert email.to == [invitation.email]
|
||||
assert email.subject == "Invitation à rejoindre La Régie !"
|
||||
assert (
|
||||
email.subject
|
||||
== "[La Suite] You have been invited to become a member of a group"
|
||||
)
|
||||
|
||||
email_content = " ".join(email.body.split())
|
||||
assert "Nous sommes ravis de vous accueillir" in email_content
|
||||
assert (
|
||||
f"""You have been invited to be a member of the group "{team.name}" within La Suite."""
|
||||
in email_content
|
||||
)
|
||||
assert "[//example.com]" in email_content
|
||||
|
||||
|
||||
|
||||
@@ -14,13 +14,24 @@ class DebugBaseView(TemplateView):
|
||||
|
||||
|
||||
# TEAM INVITATION
|
||||
class DebugViewTeamInvitationHtml(DebugBaseView):
|
||||
class DebugViewTeamInvitationBase(DebugBaseView):
|
||||
"""Debug view for team invitation base email layout"""
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Add some fake context data for team invitation email layout"""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["team"] = "example team"
|
||||
context["role"] = "owner"
|
||||
return context
|
||||
|
||||
|
||||
class DebugViewTeamInvitationHtml(DebugViewTeamInvitationBase):
|
||||
"""Debug view for team invitation html email layout"""
|
||||
|
||||
template_name = "mail/html/team_invitation.html"
|
||||
|
||||
|
||||
class DebugViewTeamInvitationTxt(DebugBaseView):
|
||||
class DebugViewTeamInvitationTxt(DebugViewTeamInvitationBase):
|
||||
"""Debug view for team invitation text email layout"""
|
||||
|
||||
template_name = "mail/text/team_invitation.txt"
|
||||
|
||||
@@ -2,56 +2,55 @@
|
||||
<mj-include path="./partial/header.mjml" />
|
||||
|
||||
<mj-body mj-class="bg--blue-100">
|
||||
<mj-wrapper css-class="wrapper" padding="0 40px 40px 40px">
|
||||
<mj-section background-url="{% base64_static 'images/mail-header-background.png' %}" background-size="cover" background-repeat="no-repeat" background-position="0 -30px">
|
||||
<mj-wrapper css-class="wrapper" padding="10px">
|
||||
<mj-section>
|
||||
<mj-column>
|
||||
<mj-image align="center" src="{% base64_static 'images/logo-suite-numerique.png' %}" width="250px" align="left" alt="{%trans 'La Suite Numérique' %}" />
|
||||
</mj-column>
|
||||
<mj-image align="center" src="{% base64_static 'images/logo-laregie.png' %}" width="157px" align="left" alt="{%trans 'La Régie' %}" padding="10px" />
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
<mj-section mj-class="bg--white-100" padding="30px 20px 60px 20px">
|
||||
<mj-section mj-class="bg--white-100">
|
||||
<mj-column>
|
||||
<mj-text font-size="14px">
|
||||
<p>{% trans "Invitation to join a team" %}</p>
|
||||
</mj-text>
|
||||
|
||||
<!-- Welcome Message -->
|
||||
<mj-divider border-width="1px" border-style="solid" border-color="#EEEEEE" width="100%" padding="10px 20px" />
|
||||
<mj-text>
|
||||
<h1>{% trans "Welcome to" %} <strong>La Régie</strong></h1>
|
||||
<strong>{% trans "Welcome to" %} La Régie</strong>
|
||||
</mj-text>
|
||||
<mj-divider border-width="1px" border-style="solid" border-color="#DDDDDD" width="30%" align="left"/>
|
||||
|
||||
<mj-image src="{% base64_static 'images/logo.png' %}" width="157px" align="left" alt="{%trans 'Logo' %}" />
|
||||
|
||||
<!-- Main Message -->
|
||||
<mj-text>{% trans "We are delighted to welcome you to our community on La Régie, your new companion to simplify the management of your groups efficiently, intuitively, and securely." %}</mj-text>
|
||||
<mj-text>{% trans "Our application is designed to help you organize, collaborate, and manage permissions." %}</mj-text>
|
||||
<mj-text>
|
||||
{% trans "With La Régie, you will be able to:" %}
|
||||
<ul>
|
||||
<li>{% trans "Create customized groups according to your specific needs."%}</li>
|
||||
<li>{% trans "Invite members of your team or community in just a few clicks."%}</li>
|
||||
<li>{% trans "Plan events, meetings, or activities effortlessly with our integrated calendar."%}</li>
|
||||
<li>{% trans "Share documents, photos, and important information securely."%}</li>
|
||||
<li>{% trans "Facilitate exchanges and communication with our messaging and group discussion tools."%}</li>
|
||||
</ul>
|
||||
<mj-text>{% trans "Hello," %}</mj-text>
|
||||
<mj-text>{% blocktranslate with team=team role=role trimmed %}
|
||||
You have been invited to be a {{ role }} of the group "{{ team }}" within La Suite.
|
||||
{% endblocktranslate %}
|
||||
</mj-text>
|
||||
<mj-button href="//{{site.domain}}" background-color="#000091" color="white" padding-bottom="30px">
|
||||
{% trans "Visit La Régie"%}
|
||||
<mj-text>{% trans "To do so, please log in La Régie via ProConnect, by following this link:" %}</mj-text>
|
||||
<mj-button href="//{{ site.domain }}" background-color="#000091" color="white" padding-bottom="30px">
|
||||
<img src="{% base64_static 'images/arrow.png' %}" width="25px" align="left" alt="arrow" background-color="red"/>
|
||||
{% trans "Go to La Régie"%}
|
||||
</mj-button>
|
||||
<mj-text>{% trans "We are confident that La Régie will help you increase efficiency and productivity while strengthening the bond among members." %}</mj-text>
|
||||
<mj-text>{% trans "Feel free to explore all the features of the application and share your feedback and suggestions with us. Your feedback is valuable to us and will enable us to continually improve our service." %}</mj-text>
|
||||
<mj-text>{% trans "Once again, welcome aboard! We are eager to accompany you on this group management adventure." %}</mj-text>
|
||||
|
||||
<!-- end Main Message -->
|
||||
<mj-text>
|
||||
<strong>{% trans "What is La Régie?" %}</strong>
|
||||
</mj-text>
|
||||
<mj-text>
|
||||
{% trans "La Suite is an open-source work environment, designed for the public sector and open to commons."%}
|
||||
</mj-text>
|
||||
<mj-text>
|
||||
{% trans "With La Suite, you will be able to create, organise and collaborate online!" %}
|
||||
</mj-text>
|
||||
<mj-text>
|
||||
{% trans "For more information:" %} <a href="https://lasuite.numerique.gouv.fr">{% trans "Visit the website for La Suite numérique" %}</a>
|
||||
</mj-text>
|
||||
<mj-text>
|
||||
{% trans "Welcome aboard!" %}
|
||||
</mj-text>
|
||||
<!-- Signature -->
|
||||
<mj-text>
|
||||
<p>{% trans "Sincerely," %}</p>
|
||||
<p>{% trans "The La Suite Numérique Team" %}</p>
|
||||
<p>{% trans "Regards," %}</p>
|
||||
<p>{% trans "La Suite Team" %}</p>
|
||||
</mj-text>
|
||||
<mj-divider border-width="1px" border-style="solid" border-color="#EEEEEE" width="100%" />
|
||||
<mj-image align="left" src="{% base64_static 'images/logo-footer-mail.png' %}" width="160px" align="left" alt="La Suite" />
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
</mj-wrapper>
|
||||
</mj-body>
|
||||
|
||||
<mj-include path="./partial/footer.mjml" />
|
||||
</mjml>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user