@php $isForIndividualContact = !__isEmpty($contact); @endphp @extends('layouts.app', ['title' => $isForIndividualContact ? __tr('Send WhatsApp Template Message') : __tr('Create New Campaign')]) @section('content') @include('users.partials.header', [ 'title' => $isForIndividualContact ? __tr('Send WhatsApp Template Message') : __tr('Create New Campaign'), 'description' => '', // 'class' => 'col-lg-7' ]) @if ($isForIndividualContact) @endif
{{--
--}}
@if(session('loggedBySuperAdmin') and !getAppSettings('enable_queue_jobs_for_campaigns') and (!getAppSettings('cron_setup_done_at')))
{{ __tr('App Alert!!') }} {{ __tr('Cron Job or Queue Worker setup is required to execute campaigns. Please see Setup and Integration page in SuperAdmin area.') }}
@endif
@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)
{{-- Load carousel template structure --}} {{-- @if(isset($carouselTemplateData) && !empty($carouselTemplateData['cards'])) @include('whatsapp-service.message-preparation', [ 'template' => $carouselTemplateData['template'], 'carouselTemplateData' => $carouselTemplateData, 'headerFormat' => null, 'headerParameters' => [], 'bodyParameters' => [], 'buttonParameters' => [], 'buttonItems' => [], 'bodyComponentText' => '', 'templateComponents' => [], 'onlyTemplatePreview' => false, 'contactDataMaps'=> $contactDataMaps ]) @else --}} {!! $template !!} {{-- @endif --}}
@include('whatsapp.from-phone-number')
@else {{-- Campaign Creation --}}
{!! $template !!}
{{--
--}}
{{--

{{ __tr('Contacts and Schedule') }}

--}}
{{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}}
@foreach($vendorContactGroups as $vendorContactGroup) @endforeach
@if (isset($allLabels) && count($allLabels) > 0)
@foreach($allLabels as $label) @endforeach
@endif
{{--
--}} {{--
--}} {{--
--}} {{--
--}}
@foreach (getTimezonesArray() as $timezone) @endforeach
{{ __tr("Messages will be set as expired if delayed in sending and won't be sent for the further processing.") }}
{{--
--}}
@include('whatsapp.from-phone-number') {{--
--}}
@endif
--}} data-callback="reloadContactGroupsDropdown">
@foreach (getCountryPhoneCodes() as $getCountryCode) @endforeach
@if (!$contact) @foreach ($vendorContactGroups as $vendorContactGroup) @endforeach @endif
@if (isAiBotAvailable()) @endif

{{ __tr('Other Information') }}


@php $vendorContactCustomFields = app(App\Yantrana\Components\Contact\Repositories\ContactCustomFieldRepository::class)->fetchItAll([ 'vendors__id' => getVendorId(), ]); @endphp @foreach ($vendorContactCustomFields as $index => $vendorContactCustomField) @if ($index % 2 === 0)
@endif @if ($index % 2 === 1 || $loop->last)
@endif @endforeach
--}} data-callback="reloadContactGroupsDropdown">
@endsection() @push('appScripts')