🐛(domains) use a dedicated mail to invite user to manage domain
- modify models to allow to specify path to mail template - rename team invitation template - fix logo and text used for domain invitation email
This commit is contained in:
@@ -3,25 +3,37 @@
|
||||
from django.urls import path
|
||||
|
||||
from .views import (
|
||||
DebugViewHtml,
|
||||
DebugViewMaildomainInvitationHtml,
|
||||
DebugViewMaildomainInvitationTxt,
|
||||
DebugViewNewMailboxHtml,
|
||||
DebugViewTxt,
|
||||
DebugViewTeamInvitationHtml,
|
||||
DebugViewTeamInvitationTxt,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
path(
|
||||
"__debug__/mail/invitation_html",
|
||||
DebugViewHtml.as_view(),
|
||||
name="debug.mail.invitation_html",
|
||||
"__debug__/mail/team_invitation_html",
|
||||
DebugViewTeamInvitationHtml.as_view(),
|
||||
name="debug.mail.team_invitation_html",
|
||||
),
|
||||
path(
|
||||
"__debug__/mail/invitation_txt",
|
||||
DebugViewTxt.as_view(),
|
||||
name="debug.mail.invitation_txt",
|
||||
"__debug__/mail/team_invitation_txt",
|
||||
DebugViewTeamInvitationTxt.as_view(),
|
||||
name="debug.mail.team_invitation_txt",
|
||||
),
|
||||
path(
|
||||
"__debug__/mail/new_mailbox_html",
|
||||
DebugViewNewMailboxHtml.as_view(),
|
||||
name="debug.mail.new_mailbox_html",
|
||||
),
|
||||
path(
|
||||
"__debug__/mail/maildomain_invitation_txt",
|
||||
DebugViewMaildomainInvitationTxt.as_view(),
|
||||
name="debug.mail.maildomain_invitation_txt",
|
||||
),
|
||||
path(
|
||||
"__debug__/mail/maildomain_invitation_html",
|
||||
DebugViewMaildomainInvitationHtml.as_view(),
|
||||
name="debug.mail.maildomain_invitation_html",
|
||||
),
|
||||
]
|
||||
|
||||
@@ -8,25 +8,49 @@ class DebugBaseView(TemplateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Generates sample datas to have a valid debug email"""
|
||||
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["title"] = "Development email preview"
|
||||
|
||||
return context
|
||||
|
||||
|
||||
class DebugViewHtml(DebugBaseView):
|
||||
"""Debug View for HTML Email Layout"""
|
||||
# TEAM INVITATION
|
||||
class DebugViewTeamInvitationHtml(DebugBaseView):
|
||||
"""Debug view for team invitation html email layout"""
|
||||
|
||||
template_name = "mail/html/invitation.html"
|
||||
template_name = "mail/html/team_invitation.html"
|
||||
|
||||
|
||||
class DebugViewTxt(DebugBaseView):
|
||||
"""Debug View for Text Email Layout"""
|
||||
class DebugViewTeamInvitationTxt(DebugBaseView):
|
||||
"""Debug view for team invitation text email layout"""
|
||||
|
||||
template_name = "mail/text/invitation.txt"
|
||||
template_name = "mail/text/team_invitation.txt"
|
||||
|
||||
|
||||
# MAIL DOMAIN INVITATION
|
||||
class DebugViewMaildomainInvitationBase(DebugBaseView):
|
||||
"""Debug view for mail domain invitation base email layout"""
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Add some fake context data for mail domain invitation email layout"""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["domain"] = "example.com"
|
||||
context["role"] = "owner"
|
||||
return context
|
||||
|
||||
|
||||
class DebugViewMaildomainInvitationHtml(DebugViewMaildomainInvitationBase):
|
||||
"""Debug view for mail domain invitation html email layout"""
|
||||
|
||||
template_name = "mail/html/maildomain_invitation.html"
|
||||
|
||||
|
||||
class DebugViewMaildomainInvitationTxt(DebugViewMaildomainInvitationBase):
|
||||
"""Debug view for mail domain invitation text email layout"""
|
||||
|
||||
template_name = "mail/text/maildomain_invitation.txt"
|
||||
|
||||
|
||||
# NEW MAILBOX
|
||||
class DebugViewNewMailboxHtml(DebugBaseView):
|
||||
"""Debug view for new mailbox email layout"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user