@php $statusColor = [ 'draft' => 'slate', 'awaiting_approval' => 'amber', 'approved' => 'sky', 'sending' => 'indigo', 'paused' => 'amber', 'completed' => 'emerald', 'cancelled' => 'slate', ]; $recipientColor = ['queued' => 'slate', 'sent' => 'emerald', 'bounced' => 'rose', 'failed' => 'rose', 'skipped' => 'amber']; $tabMeta = [ 'audience' => ['label' => __('Audience'), 'icon' => 'user-group'], 'content' => ['label' => __('Content'), 'icon' => 'envelope'], 'results' => ['label' => __('Results'), 'icon' => 'chart-bar'], ]; @endphp {{ __(App\Models\Crm\CampaignSend::STATUSES[$send->status] ?? $send->status) }}
@foreach ($tabMeta as $key => $meta) @endforeach
@if ($tab === 'audience') @if ($send->status === 'draft' && $canUpdate) @include('livewire.crm.email-campaigns.partials.form')
{{ __('Save draft') }} {{ __('Saving…') }}
@else
{{ __('Campaign') }}
{{ $send->campaign?->name }}
{{ __('Sender') }}
{{ $send->sender?->name }}
@endif @if ($counts)

{{ __('Will be emailed') }}

{{ number_format($counts['included']) }}

{{ __('Opted out') }}

{{ number_format($counts['opted_out']) }}

{{ __('Do Not Contact') }}

{{ number_format($counts['do_not_contact']) }}

{{ __('No email address') }}

{{ number_format($counts['no_email']) }}

@if ($sample !== [])
    @foreach ($sample as $person)
  • {{ $person['name'] }} {{ $person['organisation'] }}
  • @endforeach
@endif @else

{{ __('Approved audience: :count, frozen when the director approved it. Anyone who opts out after that is still left out.', ['count' => number_format($send->audience_count)]) }}

@endif
@if ($send->status === 'draft' && $canUpdate) {{ __('Submit for approval') }} {{ __('Submitting…') }} @endif @if ($send->status === 'awaiting_approval' && $canApprove) {{ __('Approve audience and content') }} {{ __('Approving…') }} @endif @if (in_array($send->status, ['awaiting_approval', 'approved'], true) && $canUpdate && $send->started_at === null) {{ __('Back to draft') }} @endif
@endif @if ($tab === 'content')

{{ __('Subject') }}

{{ $send->subject !== '' ? $send->subject : __('No subject yet') }}

{!! $send->body !== '' ? $send->body : e(__('No email yet')) !!}
@if ($example)

{{ __('Example for :name', ['name' => $example['name']]) }}

{{ $example['subject'] }}

{!! $example['html'] !!}
@endif

{{ __('Each email includes an unsubscribe link. The campaign link is tracked. Opens are not tracked.') }}

@if ($send->status === 'approved' && $send->test_sent_at === null && $canUpdate) {{ __('Send test to me') }} {{ __('Sending test…') }} @endif @if ($send->test_sent_at)

{{ __('Test sent to :email.', ['email' => $send->test_sent_to]) }}

@endif @if ($send->status === 'approved' && $send->test_sent_at && $canUpdate) {{ __('Start sending') }} {{ __('Starting…') }} @endif @if ($send->status === 'sending' && $canUpdate) {{ __('Pause') }} @endif @if ($send->status === 'paused' && $canUpdate) {{ __('Continue') }} @endif @if (in_array($send->status, ['approved', 'sending', 'paused'], true) && $canUpdate) {{ __('Cancel') }} @endif
@if ($deferUntil && in_array($send->status, ['sending', 'approved'], true))

{{ __('The sender is at the daily limit until :when.', ['when' => $deferUntil->timezone(config('app.display_timezone'))->format('j M Y, H:i')]) }}

@endif
@endif @if ($tab === 'results')
@foreach (['sent' => __('Sent'), 'queued' => __('Waiting'), 'bounced' => __('Bounced'), 'skipped' => __('Left out'), 'failed' => __('Failed')] as $key => $label)

{{ $label }}

{{ number_format((int) ($resultCounts[$key] ?? 0)) }}

@endforeach

{{ __('Recipients') }}

{{ __('Sent, bounced, replied, clicked and unsubscribed. Opens are not recorded.') }}

@forelse ($recipients as $recipient) @empty @endforelse
{{ __('Email') }} {{ __('Organisation') }} {{ __('Status') }} {{ __('Sent') }} {{ __('Replied') }} {{ __('Clicked') }} {{ __('Unsubscribed') }}
{{ $recipient->email }} {{ $recipient->customer?->name }} {{ __(App\Models\Crm\CampaignRecipient::STATUSES[$recipient->status] ?? $recipient->status) }} {{ $recipient->sent_at?->timezone(config('app.display_timezone'))->format('j M Y H:i') }} {{ $recipient->replied_at?->timezone(config('app.display_timezone'))->format('j M Y') }} {{ $recipient->clicked_at?->timezone(config('app.display_timezone'))->format('j M Y') }} {{ $recipient->unsubscribed_at?->timezone(config('app.display_timezone'))->format('j M Y') }}
{{ $recipients->links() }}
@endif