Introduce notifications app and integrate emails
Add a new notifications app (models, serializers, views, admin, tasks, consumers, routing, urls, tests) with Notification.notify for in-app websocket pushes and optional email delivery. Centralize email sending in notifications.tasks.send_email_with_context and re-export it from account.tasks for compatibility. Update account and commerce and advertisement tasks to use Notification.notify/_notify_order and the new email helper; adjust order/notification tasks to consolidate logic. Wire notifications into ASGI routing, settings and URL conf. Misc: handle OSError when importing weasyprint, add tmp/ to .gitignore, add local .claude PowerShell checks, add social.blog skeleton, and remove legacy ews-component test files.
This commit is contained in:
15
backend/notifications/serializers.py
Normal file
15
backend/notifications/serializers.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from rest_framework import serializers
|
||||
from .models import Notification
|
||||
|
||||
|
||||
class NotificationSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Notification
|
||||
fields = [
|
||||
'id', 'title', 'text', 'notification_type', 'action_url',
|
||||
'is_read', 'read_at', 'created_at', 'bulk', 'send_email',
|
||||
]
|
||||
read_only_fields = [
|
||||
'id', 'title', 'text', 'notification_type', 'action_url',
|
||||
'is_read', 'read_at', 'created_at', 'bulk', 'send_email',
|
||||
]
|
||||
Reference in New Issue
Block a user