new newsletter templates

This commit is contained in:
Chiara 2026-10-06 13:00:46 +02:00
parent 350fe68bf7
commit c30f6313bc
3 changed files with 146 additions and 44 deletions

View file

@ -6,19 +6,23 @@
</head>
<body>
<div>
<h1>Neuer Artikel:</h1>
<h3>{{data.title}}</h3>
<h4>{{data.subtitle}}</h4>
<div id="card">
<div class="center"">
<img src=" https://blauwasser-mausis.de/BWM_512.webp">
</div>
<h4 class="accent">Neuer Artikel</h4>
<p>{{data.date}} | Autor: {{data.author}} | Lesezeit: {{data.time2read}} min</p>
<h1>{{data.title}}</h1>
<h2>{{data.subtitle}}</h2>
<p>{{data.description}}</p>
<a href={{data.link}}>
<button>Zum Artikel</button>
</a>
<a href="https://blauwasser-mausis.de/blog/bootsuche-england">
<span>Abbestellen</span>
<button>⚓︎ Zum Artikel</button>
</a>
<hr>
<div class="center"><a id="hide" href="https://blauwasser-mausis.de/blog/bootsuche-england">
<span>Abbestellen</span>
</a></p>
</div>
<a id="admin" href="https://backend.blauwasser-mausis.de/?secret={{data.secret}}">Approve</a>
</div>
@ -35,18 +39,54 @@
}
div {
display: flex;
align-items: center;
flex-direction: column;
background-color: lightgrey;
padding: 32px 64px;
border-radius: 3px;
#card {
background-image: linear-gradient(to bottom, #1d3238, #3c6a7b);
padding: 16px 32px;
border-radius: 8px;
}
.center {
display: flex;
flex-direction: row;
justify-content: center;
}
img {
width: 88px;
padding: 0 0 16px 0;
}
h1,
h2,
h3,
h4 {
margin: 0;
h4,
p {
color: white;
}
.accent {
color: #ffff00;
font-weight: 600;
}
#hide {
color: #bbbebf;
font-size: 12px;
font-weight: 700;
}
h1,
h2,
h3,
h4,
p,
hr {
margin: 16px 0 16px 0;
}
p {
line-height: 1.5;
font-size: 14px;
}
button {
@ -54,6 +94,14 @@
background-color: azure;
border-radius: 3px;
border: none;
font-weight: 700;
color: #1d3238;
margin: 16px 0 24px 0;
width: 100%;
}
hr {
width: 100%;
}
#admin {

View file

@ -6,19 +6,23 @@
</head>
<body>
<div>
<h1>Hey {{data.user.name}}, es gibt einen neuen Artikel:</h1>
<h3>{{data.article.title}}</h3>
<h4>{{data.article.subtitle}}</h4>
<p>{{data.article.description}}</p>
<a href={{data.article.link}}>
<button>Zum Artikel</button>
</a>
<a href="https://blauwasser-mausis.de/">
<span>Abbestellen</span>
<div id="card">
<div class="center"">
<img src=" https://blauwasser-mausis.de/BWM_512.webp">
</div>
<h4 class="accent">Neuer Artikel</h4>
<p>{{data.date}} | Autor: {{data.author}} | Lesezeit: {{data.time2read}} min</p>
<h1>{{data.title}}</h1>
<h2>{{data.subtitle}}</h2>
<p>{{data.description}}</p>
<a href={{data.link}}>
<button>⚓︎ Zum Artikel</button>
</a>
<hr>
<div class="center"><a id="hide" href="https://blauwasser-mausis.de/blog/bootsuche-england">
<span>Abbestellen</span>
</a></p>
</div>
</div>
</body>
@ -33,18 +37,54 @@
}
div {
display: flex;
align-items: center;
flex-direction: column;
background-color: lightgrey;
padding: 32px 64px;
border-radius: 3px;
#card {
background-image: linear-gradient(to bottom, #1d3238, #3c6a7b);
padding: 16px 32px;
border-radius: 8px;
}
.center {
display: flex;
flex-direction: row;
justify-content: center;
}
img {
width: 88px;
padding: 0 0 16px 0;
}
h1,
h2,
h3,
h4 {
margin: 0;
h4,
p {
color: white;
}
.accent {
color: #ffff00;
font-weight: 600;
}
#hide {
color: #bbbebf;
font-size: 12px;
font-weight: 700;
}
h1,
h2,
h3,
h4,
p,
hr {
margin: 16px 0 16px 0;
}
p {
line-height: 1.5;
font-size: 14px;
}
button {
@ -52,5 +92,13 @@
background-color: azure;
border-radius: 3px;
border: none;
font-weight: 700;
color: #1d3238;
margin: 16px 0 24px 0;
width: 100%;
}
hr {
width: 100%;
}
</style>

View file

@ -12,21 +12,27 @@ from jinja2 import Environment, FileSystemLoader
APP_ROOT = Path(__file__).resolve().parent.parent
class ArticleData():
def __init__(self, title, subtitle, description, link):
def __init__(self, title, subtitle, description, link, date, author, time2read):
self.title=title
self.subtitle=subtitle
self.description=description
self.link=link
self.data=date
self.author=author
self.time2read = time2read
title: str
subtitle: str
description: str
link: str
date: str
author: str
time2read: str
class AdminApprovalData(ArticleData):
def __init__(self,title, subtitle, description, link, secret):
ArticleData.__init__(self, title, subtitle, description, link)
def __init__(self,title, subtitle, description, link, date, author, time2read, secret):
ArticleData.__init__(self, title, subtitle, description, link, date, author, time2read)
self.secret = secret
secret: str
@ -38,7 +44,7 @@ def create_html_from_template(template_name: str, data):
return template.render(data=data)
def send_newsletter_admin_approval(data: ArticleData ):
def send_newsletter_admin_approval(data: ArticleData):
html = create_html_from_template("approval", data)
mail = mt.Mail(