feat: implement multiline toast notification for new incoming emails

This commit is contained in:
idevakk
2026-03-06 03:14:40 +05:30
parent c35206664d
commit 5eb2c3b41f
2 changed files with 9 additions and 1 deletions

View File

@@ -101,6 +101,14 @@ class Mailbox extends Component
public function onNewEmail(array $eventData): void
{
$sender = ($eventData['sender_name'] ?? null) ?: ($eventData['sender_email'] ?? 'Unknown');
$subject = ($eventData['subject'] ?? null) ?: '(No Subject)';
$this->dispatch('notify',
message: "Sender: {$sender}\nSubject: {$subject}",
type: 'info'
);
// Simply refresh the list to pick up the new email from MariaDB
// Since we order by received_at DESC, it will appear on top.
$this->dispatch('$refresh');