feat: implement multiline toast notification for new incoming emails
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user