feat: add newsletter with mailjet
This commit is contained in:
parent
ce02ef9741
commit
483b9f3ba0
14 changed files with 53 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
.PHONY: help build publish
|
.PHONY: help build publish
|
||||||
VERSION = 1.2.2
|
VERSION = 1.2.3
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
|
@ -80,4 +80,7 @@
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
{% include 'newsletter/snippets/signup_form.html' %}
|
||||||
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -781,4 +781,7 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
{% include 'newsletter/snippets/signup_form.html' %}
|
||||||
|
</section>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
|
@ -29,6 +29,7 @@ INSTALLED_APPS = [
|
||||||
"blog",
|
"blog",
|
||||||
"home",
|
"home",
|
||||||
"search",
|
"search",
|
||||||
|
"newsletter",
|
||||||
"wagtailcodeblock",
|
"wagtailcodeblock",
|
||||||
"wagtailseo",
|
"wagtailseo",
|
||||||
"wagtail.contrib.settings",
|
"wagtail.contrib.settings",
|
||||||
|
|
|
@ -8,6 +8,7 @@ from wagtail import urls as wagtail_urls
|
||||||
from wagtail.documents import urls as wagtaildocs_urls
|
from wagtail.documents import urls as wagtaildocs_urls
|
||||||
|
|
||||||
from blog.feeds import RssBlogFeed
|
from blog.feeds import RssBlogFeed
|
||||||
|
from newsletter import views as newsletter_views
|
||||||
from search import views as search_views
|
from search import views as search_views
|
||||||
from wagtail.contrib.sitemaps.views import sitemap
|
from wagtail.contrib.sitemaps.views import sitemap
|
||||||
from base.views import KeyView
|
from base.views import KeyView
|
||||||
|
@ -20,7 +21,8 @@ urlpatterns = [
|
||||||
path("blog/feed/", RssBlogFeed(), name="blog_feed"),
|
path("blog/feed/", RssBlogFeed(), name="blog_feed"),
|
||||||
path('sitemap.xml', sitemap),
|
path('sitemap.xml', sitemap),
|
||||||
path('robots.txt', TemplateView.as_view(template_name="robots.txt", content_type="text/plain")),
|
path('robots.txt', TemplateView.as_view(template_name="robots.txt", content_type="text/plain")),
|
||||||
path('<str:key>.txt', KeyView.as_view())
|
path('<str:key>.txt', KeyView.as_view()),
|
||||||
|
path('newsletter/thanks', newsletter_views.thanks, name='thanks')
|
||||||
]
|
]
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
|
|
0
newsletter/__init__.py
Normal file
0
newsletter/__init__.py
Normal file
3
newsletter/admin.py
Normal file
3
newsletter/admin.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
6
newsletter/apps.py
Normal file
6
newsletter/apps.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class NewsletterConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'newsletter'
|
0
newsletter/migrations/__init__.py
Normal file
0
newsletter/migrations/__init__.py
Normal file
3
newsletter/models.py
Normal file
3
newsletter/models.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
|
@ -0,0 +1,4 @@
|
||||||
|
<div class="py-16 sm:py-24 lg:py-32">
|
||||||
|
<iframe data-w-type="embedded" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://sgx7y.mjt.lu/wgt/sgx7y/xtn1/form?c=c9b8015e" width="100%" style="height: 0;"></iframe>
|
||||||
|
<script type="text/javascript" src="https://app.mailjet.com/pas-nc-embedded-v1.js"></script>
|
||||||
|
</div>
|
15
newsletter/templates/newsletter/thanks.html
Normal file
15
newsletter/templates/newsletter/thanks.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load static wagtailcore_tags %}
|
||||||
|
|
||||||
|
{% block title %}Newsletter{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="min-h-96 flex flex-col">
|
||||||
|
<section class="flex-grow h-full px-0 md:px-4 lg:px-8">
|
||||||
|
<div class="px-0 md:px-4 lg:px-8">
|
||||||
|
<h1>Thank you</h1>
|
||||||
|
Your newsletter subscription is confirmed.
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
3
newsletter/tests.py
Normal file
3
newsletter/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
8
newsletter/views.py
Normal file
8
newsletter/views.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
from django.template.response import TemplateResponse
|
||||||
|
|
||||||
|
|
||||||
|
def thanks(request):
|
||||||
|
return TemplateResponse(
|
||||||
|
request,
|
||||||
|
"newsletter/thanks.html",
|
||||||
|
)
|
Loading…
Add table
Add a link
Reference in a new issue