Skip to content

Commit 2dee349

Browse files
committed
feat: Add contact information block to the email verification page
1 parent 3adb655 commit 2dee349

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

base/views.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from allauth.account.views import EmailVerificationSentView
2+
3+
4+
class DjangoSnippetsEmailVerificationSentView(EmailVerificationSentView):
5+
MAINTAINER_EMAILS = [
6+
"antoliny0919@gmail.com",
7+
"wedgemail@gmail.com",
8+
]
9+
10+
def get_context_data(self, **kwargs):
11+
context = super().get_context_data(**kwargs)
12+
context["maintainer_emails"] = self.MAINTAINER_EMAILS
13+
return context

djangosnippets/templates/account/verification_sent.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@ <h3>Email Verification</h3>
1212
<img src="{% static 'img/verification_sent.png' %}">
1313
<p class="my-4 text-xl font-common">We have sent an e-mail to you for verification 🚀</p>
1414
<p class="text-center">Follow the link provided to finalize the signup process. If you do not see the verification email in your main inbox, check your spam folder.</p>
15+
{% if maintainer_emails %}
16+
<div class="flex flex-col justify-center items-center" x-data="{ show: false }">
17+
<button
18+
class="p-0 m-0 text-base-white border-2 px-4 py-2 rounded-lg font-text"
19+
:class="show ? 'bg-base-green-400' : 'bg-base-green-600 hover:bg-base-green-400'"
20+
@click="show = !show"
21+
>
22+
Didn't receive the email ?
23+
</button>
24+
<div x-show="show" class="text-center my-4 text-base" x-transition>
25+
<span>If you didn't receive the verification email, please contact us at:</span>
26+
<div class="flex justify-center gap-4 mt-2">
27+
{% for email in maintainer_emails %}
28+
<a class="underline" href="mailto:{{ email }}">{{ email }}</a>
29+
{% endfor %}
30+
</div>
31+
</div>
32+
</div>
33+
{% endif %}
1534
</div>
1635
{% endblock %}
1736
{% block footer %}{% endblock %}

djangosnippets/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from django.shortcuts import render
33
from django.urls import include, path
44

5+
from base.views import DjangoSnippetsEmailVerificationSentView
6+
57
admin.autodiscover()
68

79

@@ -11,6 +13,7 @@ def trigger_sentry_error(request):
1113

1214
urlpatterns = [
1315
path("sentry-debug/", trigger_sentry_error),
16+
path("accounts/confirm-email/", DjangoSnippetsEmailVerificationSentView.as_view(), name="account_email_verification_sent"),
1417
path("accounts/", include("allauth.urls")),
1518
path("manage/", admin.site.urls),
1619
path("components/", include("django_components.urls")),

0 commit comments

Comments
 (0)