Add weekly new products email and related features

Introduces a weekly summary email for newly added products, including a new email template and Celery periodic task. Adds 'include_in_week_summary_email' to Product and 'newsletter' to CustomUser. Provides an admin endpoint to manually trigger the weekly email, updates Celery Beat schedule, and adds email templates for verification and password reset.
This commit is contained in:
2026-01-22 00:22:21 +01:00
parent c0bd24ee5e
commit 963ba6b824
10 changed files with 308 additions and 7 deletions

View File

@@ -0,0 +1,75 @@
<style>
.reset-container {
text-align: center;
font-family: Arial, sans-serif;
padding: 20px 0;
}
.reset-title {
color: #333;
font-size: 24px;
margin: 0 0 20px 0;
font-weight: bold;
}
.reset-text {
color: #666;
font-size: 16px;
line-height: 1.5;
margin: 0 0 30px 0;
}
.reset-button {
display: inline-block;
background-color: #007bff;
color: white !important;
text-decoration: none;
padding: 12px 30px;
border-radius: 5px;
font-weight: bold;
font-size: 16px;
margin: 0 0 20px 0;
}
.reset-warning {
color: #856404;
background-color: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 4px;
padding: 15px;
margin: 20px 0;
font-size: 14px;
}
.security-note {
color: #999;
font-size: 12px;
margin-top: 20px;
}
</style>
<div class="reset-container">
<h1 class="reset-title">🔐 Obnova hesla</h1>
<p class="reset-text">
Dobrý den {{ user.first_name|default:user.username }},<br><br>
Obdrželi jsme požadavek na obnovení hesla k vašemu účtu.
Klikněte na tlačítko níže pro vytvoření nového hesla.
</p>
<a href="{{ action_url }}" class="reset-button">{{ cta_label }}</a>
<div class="reset-warning">
<strong>⚠️ Bezpečnostní upozornění:</strong><br>
Pokud jste o obnovu hesla nepožádali, ignorujte tento e-mail.
Váše heslo zůstane nezměněno.
</div>
<p class="reset-text">
Odkaz pro obnovu hesla je platný pouze po omezenou dobu.
Pokud odkaz nefunguje, zkopírujte a vložte následující adresu do prohlížeče:
</p>
<p style="word-break: break-all; color: #007bff; font-size: 14px;">
{{ action_url }}
</p>
<p class="security-note">
Tento odkaz je určen pouze pro vás a nelze ho sdílet s ostatními.
</p>
</div>