@if($type)

@if($type === 'local_newsletter') {{ __('Sent to users based on their location preferences') }} @elseif($type === 'general_newsletter') {{ __('Sent to all subscribed users and organizations') }} @elseif($type === 'system_message') {{ __('System announcements and important notices') }} @endif

@endif

{{ __('Enter subject lines for each language based on your selected posts') }}

@if(count($availableLocales) > 0)
@foreach($availableLocales as $locale)
{{ strtoupper($locale) }} ({{ $locale === 'en' ? 'English' : ($locale === 'nl' ? 'Nederlands' : ($locale === 'de' ? 'Deutsch' : ($locale === 'es' ? 'Español' : ($locale === 'fr' ? 'Français' : $locale)))) }}) @if($locale === timebank_config('base_language', 'en')) {{ __('Primary') }} @endif
@endforeach
@else

{{ __('Select posts to see available languages') }}

{{ __('Subject fields will appear based on your post translations') }}

@endif
{{ __('Add Posts') }}
@if(empty($selectedPosts))

{{ __('No posts selected yet') }}

@else
@foreach($selectedPosts as $index => $post)
{{ $post['order'] }}

{{ $post['title'] }}

Post ID: {{ $post['post_id'] }}

@if($index > 0) @endif @if($index < count($selectedPosts) - 1) @endif
@endforeach
@endif
@if($filterByProfileType)

{{ __('Select which profile types should receive this mailing. You can select multiple types.') }}

@if(count($selectedProfileTypes) > 0)
@foreach($selectedProfileTypes as $profileType) @switch($profileType) @case('User') {{ __('Users') }} @break @case('Organization') {{ __('Organizations') }} @break @case('Bank') {{ __('Banks') }} @break @case('Admin') {{ __('Admins') }} @break @endswitch @endforeach
@endif

{{ __('Tip: Hold Ctrl (Windows/Linux) or Cmd (Mac) while clicking to select multiple profile types') }}

@if(count($selectedProfileTypes) > 0)

{{ __('Filtering by :count profile type(s)', ['count' => count($selectedProfileTypes)]) }}

@endif
@endif
@if($type === 'local_newsletter')
@if($filterByLocation)

{{ __('Select a location to filter recipients. Only profiles with their primary location in the selected area will receive this mailing.') }}

@if(count($selectedCountryIds) > 0 || count($selectedDivisionIds) > 0 || count($selectedCityIds) > 0 || count($selectedDistrictIds) > 0) @php $locationFilteredCount = collect($this->getCurrentRecipientCountsByLocale())->sum('count'); @endphp

{{ __('Estimated recipients with location filter: :count', ['count' => number_format($locationFilteredCount)]) }}

@endif
@endif
@endif

{{ __('Estimated Recipients') }}

@if($type)

{{ __('messages.mailings.recipients_info.' . $type) }} @if($filterByLocation && (count($selectedCountryIds) > 0 || count($selectedDivisionIds) > 0 || count($selectedCityIds) > 0 || count($selectedDistrictIds) > 0))
{{ __('messages.mailings.recipients_info.location_filtering_active') }} @endif

@else

{{ __('messages.mailings.recipients_info.no_type_selected') }}

@endif @if($type) @php $currentRecipientCount = collect($this->getCurrentRecipientCountsByLocale())->sum('count'); @endphp @if($currentRecipientCount > 0)

{{ __('Current estimated recipients: :count', ['count' => number_format($currentRecipientCount)]) }}

@endif @else

{{ __('Current estimated recipients: 0') }}

@endif @if($type)

{{ __('Recipients by Language & Content') }}

@php $countsByLocale = $this->getCurrentRecipientCountsByLocale(); @endphp @if(count($countsByLocale) > 0)
@foreach($countsByLocale as $locale => $data) @php $language = \App\Models\Language::where('lang_code', $locale)->first(); $flag = $language ? $language->flag : '🏳️'; $languageName = $language ? $language->name : strtoupper($locale); @endphp
{{ $flag }} {{ $languageName }}
{{ number_format($data['count']) }} {{ __('recipients') }} @if($data['has_content']) {{ $data['content_blocks'] }} {{ __('posts') }} @else {{ __('No content') }} @endif
@endforeach
@php $totalRecipients = collect($countsByLocale)->sum('count'); $effectiveRecipients = collect($countsByLocale)->where('has_content', true)->sum('count'); @endphp
{{ __('Total recipients:') }} {{ number_format($totalRecipients) }}
{{ __('Will receive mailing:') }} {{ number_format($effectiveRecipients) }}
@if($effectiveRecipients != $totalRecipients)

{{ __('Some recipients will not receive the mailing due to missing content in their language.') }}

@endif
@else

{{ __('No recipients found for this mailing type.') }}

@endif
@endif