@extends('layouts.app') @section('css') @endsection @section('content')

{{ $type }}


{{--

Welcome to your inbox Mail Dashboard

--}} {{--
--}} {{--

Emails ({{ $type }})

--}} {{-- {{ dd($mails) }} --}} @if ($mails->isEmpty())

No mails available

@else {{-- --}} @if ($type == 'Reply pending mail') @endif @if ($type == 'Replied Mail') {{-- --}} @endif @if ($type == 'Read Mail' || $type == 'Un-Read Mail' || $type == 'All Mail') @if ($type == 'All Mail') {{-- --}} @endif {{-- --}} {{-- @elseif ($type == 'send-mail') --}} @endif @foreach ($mails as $mail) {{-- @php $currentEmail = isset($employee) ? $employee->email : Auth::user()->email ?? 'Guest'; @endphp @if ($mail->sender_email === $currentEmail) @continue @endif --}} @php // Create DateTime objects in Asia/Kolkata timezone $sent = new DateTime($mail->sent_date, new DateTimeZone('Asia/Kolkata')); $replied = new DateTime($mail->sent_date_s, new DateTimeZone('Asia/Kolkata')); @endphp @if ($type == 'Reply pending mail') @php $now = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $interval = $sent->diff($now); // Difference formatting $diffParts = []; if ($interval->y) { $diffParts[] = "{$interval->y} years"; } if ($interval->m) { $diffParts[] = "{$interval->m} months"; } if ($interval->d) { $diffParts[] = "{$interval->d} days"; } if ($interval->h) { $diffParts[] = "{$interval->h} hours"; } if ($interval->i) { $diffParts[] = "{$interval->i} minutes"; } if ($interval->s) { $diffParts[] = "{$interval->s} seconds"; } $diffText = implode(' ', $diffParts) . ' ago'; // Color logic if ($interval->y >= 2) { $color = 'text-dark'; } elseif ($interval->y >= 1) { $color = 'text-secondary'; } elseif ($interval->m >= 6) { $color = 'text-warning'; } elseif ($interval->m >= 1) { $color = 'text-danger'; } elseif ($interval->d >= 2) { $color = 'text-danger'; } elseif ($interval->d == 1) { $color = 'text-primary'; } else { $color = 'text-success'; } @endphp @endif @if ($type == 'Replied Mail') @php $interval = $sent->diff($replied); $diffParts = []; if ($interval->y) { $diffParts[] = "{$interval->y} years"; } if ($interval->m) { $diffParts[] = "{$interval->m} months"; } if ($interval->d) { $diffParts[] = "{$interval->d} days"; } if ($interval->h) { $diffParts[] = "{$interval->h} hours"; } if ($interval->i) { $diffParts[] = "{$interval->i} minutes"; } if ($interval->s) { $diffParts[] = "{$interval->s} seconds"; } $diffText = implode(' ', $diffParts); // Color logic if ($interval->y >= 1) { $color = 'text-secondary'; } elseif ($interval->m >= 1) { $color = 'text-warning'; } elseif ($interval->d >= 2) { $color = 'text-danger'; } elseif ($interval->d == 1) { $color = 'text-primary'; } else { $color = 'text-success'; } @endphp {{-- --}} @endif @if ($type == 'Read Mail' || $type == 'Un-Read Mail' || $type == 'All Mail') @if ($type == 'All Mail') {{-- Sentiment --}} {{-- Category --}} {{-- --}} @endif {{-- --}} {{-- @elseif ($type == 'send-mail') --}} @endif {{-- --}} @endforeach
ID User ID Sender Name Sender Email Subject Attachment Sent Dateis_spamWaiting for Reply SinceReplied DateResponse TimeMessage Status SentimentGroup ByAction RequiredTypes MailSpam StatusActions
{{ $loop->iteration }} {{ $mail->email_id }} {{ $mail->sender_name }} {{ $mail->sender_email }} {{ $mail->subject === 'No Subject' ? '-' : $mail->subject }} {{ $mail->attachment_status == 1 ? 'Yes' : 'No' }} {{ $sent->format('d M Y H:i A') }}{{ $diffText }}{{ $replied->format('d M Y H:i A') }}{{ $diffText }}{{ $mail->message_status == 1 ? 'Read' : 'Unread' }} {{ $mail->is_promotion == 1 ? 'Promotion / ' : '' }}{{ ucfirst($mail->is_spam_value) }} {{$mail->is_category_value }} {{ $mail->action_required == 1 ? 'Yes' : 'No' }} @php switch ($mail->is_spam) { case 0: $statusText = 'Negative'; break; case 1: $statusText = 'Positive'; break; case 2: $statusText = 'Reply Mail'; break; case 3: $statusText = 'Neutral'; break; case 4: $statusText = 'Promotion'; break; case 5: $statusText = 'Sales'; break; case 6: $statusText = 'AMC'; break; default: $statusText = 'Unknown'; break; } @endphp {{ $statusText }} ok{{ $mail->is_spam }}1
View {{--
--}} {{-- --}} {{-- {{ $counts['countis_not_spam_heading'] ?? 'Negative' }} --}} {{-- View @if ($mail->new_feteched_data == '0') --}} {{-- ! --}} {{-- {{ $mail->related_message_status }} --}} {{-- {{ $mail->message_status }}{{ $mail->related_email_id }} --}} {{-- @endif --}} {{--
--}} @if ($mail->sent_mail_id != -1) {{-- {{ $mail->sent_mail_id }} --}} {{-- {{ $mail->action_required }} --}} @if ($mail->action_required == 1) @endif @endif
{{-- View --}}
{{--
Today (Success / Green)
1 Day (Primary / Blue)
2 Days (Warning / Yellow)
6+ Months (Danger / Red)
1 Year (Secondary / Grey)
2+ Years (Dark)
--}} {{-- @if ($type == 'all') @elseif ($type != 'Read') @endif @foreach ($mails as $mail) @if ($type == 'all') @elseif ($type != 'Read') @endif @endforeach
ID Sender Name Sender Email Subject Sent Date Attachment Message StatusSpam StatusActions
{{ $mail->email_id }} {{ $mail->sender_name }} {{ $mail->sender_email }} {{ $mail->subject }} {{ $mail->sent_date }} {{ $mail->attachment_status == 1 ? 'Yes' : 'No' }} {{ $mail->message_status == 1 ? 'Read' : 'Unread' }}{{ $mail->is_spam == 1 ? 'Not Spam' : 'Spam' }} View
--}} @endif {{--
{{ $mails->links('pagination::bootstrap-5') }}
--}} {{--
--}} @endsection @push('scripts') @endpush