@if ($contact)
@else
@if(!getVendorSettings('test_recipient_contact'))
{{ __tr('Test Contact missing, You need to set the Test Contact first, do it under the WhatsApp Settings') }}
@if (!$contact)
{{ __tr('Step 1') }}
@endif
{{ __tr('Select & Configure Template') }}
@foreach ($whatsAppTemplates as $whatsAppTemplate)
{{ $whatsAppTemplate->template_name }}
({{ $whatsAppTemplate->language }})
@endforeach
@if ($contact)
{!! $template !!}
@include('whatsapp.from-phone-number')
{{ __('Send') }}
@else
{{-- Campaign Creation --}}
{!! $template !!}
{{ __tr('Step 2') }}
{{ __tr('Contacts and Schedule') }}
{{-- Campaign Title --}}
{{-- Contact Group Select --}}
{{-- Debug: Log contact groups data --}}
@php
$groupNames = [];
if (isset($vendorContactGroups) && is_array($vendorContactGroups)) {
foreach ($vendorContactGroups as $group) {
$groupNames[] = $group['title'] ?? 'No title';
}
}
\Log::info('Frontend - Contact groups data:', [
'totalContactsCount' => $totalContactsCount ?? 'Not set',
'vendorContactGroups_count' => count($vendorContactGroups ?? []),
'group_names' => $groupNames,
'vendorContactGroups_data' => $vendorContactGroups ?? 'Not set'
]);
@endphp
{{ __tr('Select Contacts Group') }}
{{ __tr('All Contacts') }} ({{ $totalContactsCount ?? 0 }} {{ __tr('contacts') }})
@if(isset($vendorContactGroups) && is_array($vendorContactGroups))
@foreach($vendorContactGroups as $vendorContactGroup)
{{ $vendorContactGroup['title'] }} ({{ $vendorContactGroup['contacts_count'] ?? 0 }} {{ __tr('contacts') }})
@endforeach
@else
{{-- Debug: Show if no data --}}
No contact groups found
@endif
{{-- Contacts Display Section --}}
{{-- Individual Phone Numbers --}}
{{ __tr('Individual Phone Numbers') }}
{{ __tr('Optional') }}
{{ __tr('Enter phone numbers with country code (without + or 0 prefix). Only numeric input allowed. Commas will be automatically added after every 12 digits.') }}
{{ __tr('๐ก Tip: You can send to individual numbers without selecting a contact group!') }}
{{-- Restrict by Template Language --}}
{!! __tr('Restrict by Language Code - Send only to the contacts whose language code matches with template language code.') !!}
{{-- Schedule Field --}}
{{ __tr('Schedule') }}
{{ __tr('Now') }}
{{-- Timezone + Schedule At --}}
@foreach (getTimezonesArray() as $timezone)
{{ $timezone['text'] }}
@endforeach
{{-- Phone Number Include --}}
@include('whatsapp.from-phone-number')
{{-- Submit Button --}}
{{ __('Schedules Campaign ') }}
{{ __tr('Are you sure?') }}
{{ __tr('You want to schedule a WhatsApp Template Message. Test message will be sent to your selected test contact immediately and on success it will get scheduled for the selected group contacts ') }}
@endif