show mail attachments in frontend

This commit is contained in:
j3d1 2024-01-14 16:01:32 +01:00
parent d1626d1777
commit 04f774404a
11 changed files with 252 additions and 23 deletions

View file

@ -10,6 +10,7 @@ from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from core.settings import MAIL_DOMAIN
from mail.api_v2 import AttachmentSerializer
from mail.models import Email
from mail.protocol import send_smtp, make_reply, collect_references
from notify_sessions.models import SystemEvent
@ -75,6 +76,7 @@ class IssueSerializer(serializers.ModelSerializer):
'recipient': email.recipient,
'subject': email.subject,
'body': email.body,
'attachments': AttachmentSerializer(email.attachments.all(), many=True).data,
})
return sorted(timeline, key=lambda x: x['timestamp'])