feat: add newsletter with mailjet

This commit is contained in:
Konstantin 2024-10-07 09:26:43 +02:00
parent ce02ef9741
commit 483b9f3ba0
14 changed files with 53 additions and 2 deletions

0
newsletter/__init__.py Normal file
View file

3
newsletter/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
newsletter/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class NewsletterConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'newsletter'

View file

3
newsletter/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

@ -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>

View 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
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

8
newsletter/views.py Normal file
View file

@ -0,0 +1,8 @@
from django.template.response import TemplateResponse
def thanks(request):
return TemplateResponse(
request,
"newsletter/thanks.html",
)