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:
78
backend/templates/email/email_verification.html
Normal file
78
backend/templates/email/email_verification.html
Normal file
@@ -0,0 +1,78 @@
|
||||
<style>
|
||||
.verification-container {
|
||||
text-align: center;
|
||||
font-family: Arial, sans-serif;
|
||||
padding: 20px 0;
|
||||
}
|
||||
.verification-title {
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
margin: 0 0 20px 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.verification-text {
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
margin: 0 0 30px 0;
|
||||
}
|
||||
.verification-button {
|
||||
display: inline-block;
|
||||
background-color: #28a745;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 12px 30px;
|
||||
border-radius: 5px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
.verification-info {
|
||||
color: #0c5460;
|
||||
background-color: #d1ecf1;
|
||||
border: 1px solid #bee5eb;
|
||||
border-radius: 4px;
|
||||
padding: 15px;
|
||||
margin: 20px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.welcome-note {
|
||||
color: #333;
|
||||
background-color: #f8f9fa;
|
||||
border-left: 4px solid #28a745;
|
||||
padding: 15px;
|
||||
margin: 20px 0;
|
||||
font-size: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="verification-container">
|
||||
<h1 class="verification-title">✉️ Ověření e-mailové adresy</h1>
|
||||
|
||||
<p class="verification-text">
|
||||
Vítejte {{ user.first_name|default:user.username }}!<br><br>
|
||||
Děkujeme za registraci. Pro dokončení vytvoření účtu je nutné
|
||||
ověřit vaši e-mailovou adresu kliknutím na tlačítko níže.
|
||||
</p>
|
||||
|
||||
<a href="{{ action_url }}" class="verification-button">{{ cta_label }}</a>
|
||||
|
||||
<div class="welcome-note">
|
||||
<strong>🎉 Těšíme se na vás!</strong><br>
|
||||
Po ověření e-mailu budete moci využívat všechny funkce naší platformy
|
||||
a začít nakupovat nebo prodávat.
|
||||
</div>
|
||||
|
||||
<div class="verification-info">
|
||||
<strong>ℹ️ Co dělat, když tlačítko nefunguje?</strong><br>
|
||||
Zkopírujte a vložte následující odkaz do adresního řádku prohlížeče:
|
||||
<br><br>
|
||||
<span style="word-break: break-all; font-family: monospace; font-size: 12px;">{{ action_url }}</span>
|
||||
</div>
|
||||
|
||||
<p class="verification-text" style="font-size: 14px; color: #999;">
|
||||
Odkaz pro ověření je platný po omezenou dobu.
|
||||
Pokud jste se neregistrovali na našich stránkách, ignorujte tento e-mail.
|
||||
</p>
|
||||
</div>
|
||||
75
backend/templates/email/password_reset.html
Normal file
75
backend/templates/email/password_reset.html
Normal 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>
|
||||
Reference in New Issue
Block a user