@extends('crm.layouts.master') @section('title', 'Email — ' . $folderSlug) @section('page-css') @endsection @section('main-content')
@if(!empty($mailboxError)) @endif
{{-- ═══════════ SIDEBAR ═══════════ --}} {{-- ═══════════ MAIN CONTENT ═══════════ --}}
@switch($folderSlug) @case('INBOX') Inbox @break @case('Sent') Sent @break @case('Drafts') Drafts @break @case('Spam') Spam @break @case('Trash') Trash @break @default {{ $folderSlug }} @endswitch {{ count($emails) }} messages
@forelse($emails as $email) @php $initial = strtoupper(substr($email['sender'] ?: $email['sender_email'], 0, 1)); $colors = ['a','b','c','d','e']; $colorIdx = ord(strtolower($initial ?: 'a')) % 5; $avatarCls= 'avatar-' . $colors[$colorIdx]; $unread = !($email['is_seen'] ?? true); @endphp @empty @endforelse
{{ $folderSlug === 'Sent' ? 'To' : 'From' }} Subject Preview Date
{{ $initial ?: '?' }} {{ $email['sender'] ?: $email['sender_email'] }} @if($email['sender'] && $email['sender_email']) <{{ $email['sender_email'] }}> @endif {{ $email['subject'] }} {{ Str::limit(strip_tags($email['message']), 90) }} @if($email['date']->isToday()) {{ $email['date']->format('g:i A') }} @elseif($email['date']->isCurrentYear()) {{ $email['date']->format('M d') }} @else {{ $email['date']->format('d/m/Y') }} @endif
No messages in this folder.
{{-- ═══════════ VIEW EMAIL MODAL ═══════════ --}} {{-- ═══════════ REPLY MODAL ═══════════ --}} {{-- ═══════════ COMPOSE MODAL ═══════════ --}} @endsection @section('page-js') @endsection