Refactor email system and add contact form backend
Refactored email sending to use a single HTML template with a base layout, removed plain text email templates, and updated all related backend logic. Introduced a new ContactMe model, serializer, Celery task, and API endpoints for handling contact form submissions, including email notifications. Renamed ShopConfiguration to SiteConfiguration throughout the backend for consistency. Updated frontend to remove unused components, add a new Services section, and adjust navigation and contact form integration.
This commit is contained in:
@@ -1,2 +1,17 @@
|
||||
#udělat zasílaní reklamních emailů uživatelům.
|
||||
#newletter --> když se vytvoří nový record s reklamou email se uloží pomocí zaškrtnutí tlačítka v záznamu
|
||||
from account.tasks import send_email_with_context
|
||||
from configuration.models import SiteConfiguration
|
||||
|
||||
from celery import shared_task
|
||||
|
||||
@shared_task
|
||||
def send_contact_me_email_task(client_email, message_content):
|
||||
context = {
|
||||
"client_email": client_email,
|
||||
"message_content": message_content
|
||||
}
|
||||
send_email_with_context(
|
||||
recipients=SiteConfiguration.get_solo().contact_email,
|
||||
subject="Poptávka z kontaktního formuláře!!!",
|
||||
template_path="email/contact_me.html",
|
||||
context=context,
|
||||
)
|
||||
Reference in New Issue
Block a user