@extends('layouts.app', ['title' => $contact ? __tr('Send WhatsApp Template Message') : __tr('Create New Campaign')]) @section('content') @include('users.partials.header', [ 'title' => $contact ? __tr('Send WhatsApp Template Message') : __tr(''), 'description' => '', // 'class' => 'col-lg-7' ])
@if ($contact)
{{ __tr('Name') }} : {{ $contact->full_name }}
{{ __tr('Phone') }} : {{ $contact->wa_id }}
{{ __tr('Country') }} : {{ $contact->country?->name }}
@else @if(!getVendorSettings('test_recipient_contact'))
{{ __tr('Test Contact missing, You need to set the Test Contact first, do it under the WhatsApp Settings') }}
@endif @endif
@if (!$contact)

{{ __tr('Step 1') }}

@endif
@foreach ($whatsAppTemplates as $whatsAppTemplate) @endforeach
@if ($contact)
{!! $template !!}
@include('whatsapp.from-phone-number')
@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 @if(isset($vendorContactGroups) && is_array($vendorContactGroups)) @foreach($vendorContactGroups as $vendorContactGroup) @endforeach @else {{-- Debug: Show if no data --}} @endif
{{-- Contacts Display Section --}}
{{-- Individual Phone Numbers --}}
{{ __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 --}}
{{-- Schedule Field --}}
{{ __tr('Schedule') }}
{{-- Timezone + Schedule At --}}
@foreach (getTimezonesArray() as $timezone) @endforeach
{{-- Phone Number Include --}} @include('whatsapp.from-phone-number') {{-- Submit Button --}}
@endif
@endsection() @push('appStyles') @endpush @push('appScripts') @endpush