{{ __('whatsapp::app.whatsappSettings') }}

{{ __('whatsapp::app.enableWhatsapp') }}
{{ __('whatsapp::app.enableWhatsappDescription') }}
@if ($isEnabled)

{{ __('whatsapp::app.wabaIdHelp') }}

{{ __('whatsapp::app.phoneNumberIdHelp') }}

{{ __('whatsapp::app.accessTokenHelp') }}

{{ __('whatsapp::app.verifyTokenHelp') }}

{{ __('whatsapp::app.testConnection') }}
@endif
@lang('app.save')

{{ __('whatsapp::app.templateLibrary') }}

{{ __('whatsapp::app.templateLibraryDescription') }}

@if($templates->where('category', 'all')->count() > 0) @endif
@forelse($templates as $template) @if($selectedCategory === null || $template->category === $selectedCategory)

{{ $template->template_name }}

{{ $template->description ?? __('whatsapp::app.noDescription') }}

{{ ucfirst($template->category) }}
{{ __('whatsapp::app.template') }}: {{ $template->notification_type }}
@endif @empty

{{ __('whatsapp::app.noTemplatesFound') }}

@endforelse
@if($selectedTemplate && $templateDetails)

{{ __('whatsapp::app.templateCreationGuide') }}

{{ __('whatsapp::app.followStepsBelow') }} {{ __('whatsapp::app.metaPortal') }}

{{ __('whatsapp::app.importantVariableRules') }}
  • {{ __('whatsapp::app.header') }} {{ __('whatsapp::app.variables') }}: {{ __('whatsapp::app.startFrom') }} {{1}} ({{ __('whatsapp::app.separateScope') }})
  • {{ __('whatsapp::app.body') }} {{ __('whatsapp::app.variables') }}: {{ __('whatsapp::app.startFrom') }} {{1}} ({{ __('whatsapp::app.separateScope') }}, {{ __('whatsapp::app.independentFromHeader') }})
  • {{ __('whatsapp::app.footer') }}: {{ __('whatsapp::app.noVariablesAllowed') }} - {{ __('whatsapp::app.footerMustBeStatic') }}
1
{{ $templateDetails['name'] }}

{{ __('whatsapp::app.enterInNameField') }}

@if($templatePreview || $previewError)
👁️

{{ __('whatsapp::app.templatePreviewDescription') }}

@if($previewError)

{{ __('whatsapp::app.errorLoadingPreview') }}

{{ $previewError }}

@endif @if($templatePreview)

{{ __('whatsapp::app.templateStatus') }}

@php $status = $templatePreview['status'] ?? 'UNKNOWN'; $statusMap = [ 'APPROVED' => ['label' => __('whatsapp::app.statusApproved'), 'class' => 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300', 'icon' => '✓'], 'PENDING' => ['label' => __('whatsapp::app.statusPendingReview'), 'class' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300', 'icon' => '⏳'], 'PENDING_DELETION' => ['label' => __('whatsapp::app.statusPendingDeletion'), 'class' => 'bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-300', 'icon' => '🗑️'], 'REJECTED' => ['label' => __('whatsapp::app.statusRejected'), 'class' => 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-300', 'icon' => '✗'], 'DISABLED' => ['label' => __('whatsapp::app.statusDisabled'), 'class' => 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300', 'icon' => '⊘'], 'LIMIT_EXCEEDED' => ['label' => __('whatsapp::app.statusLimitExceeded'), 'class' => 'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300', 'icon' => '⚠'], 'PAUSED' => ['label' => __('whatsapp::app.statusPaused'), 'class' => 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300', 'icon' => '⏸'], ]; $statusInfo = $statusMap[$status] ?? ['label' => $status, 'class' => 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300', 'icon' => '?']; @endphp {{ $statusInfo['icon'] }} {{ $statusInfo['label'] }} {{ $templatePreview['category'] ?? 'UTILITY' }} {{ strtoupper($templatePreview['language'] ?? 'en') }} @if(isset($templatePreview['quality_score'])) {{ __('whatsapp::app.quality') }}: {{ $templatePreview['quality_score']['score'] ?? __('whatsapp::app.statusUnknown') }} @endif
@if($status === 'REJECTED' && isset($templatePreview['reason']))

{{ __('whatsapp::app.rejectionReason') }}:

{{ $templatePreview['reason'] }}

@endif
@if(isset($templatePreview['components'])) @foreach($templatePreview['components'] as $component) @if($component['type'] === 'HEADER')
@if($component['format'] === 'TEXT')
{{ $component['text'] ?? __('whatsapp::app.headerText') }}
@elseif($component['format'] === 'IMAGE')
{{ __('whatsapp::app.imagePlaceholder') }}
@elseif($component['format'] === 'VIDEO')
{{ __('whatsapp::app.videoPlaceholder') }}
@elseif($component['format'] === 'DOCUMENT')
{{ __('whatsapp::app.documentPlaceholder') }}
@endif
@endif @if($component['type'] === 'BODY')
{{ trim($component['text'] ?? __('whatsapp::app.bodyText')) }}
@endif @if($component['type'] === 'FOOTER')
{{ trim($component['text'] ?? __('whatsapp::app.footerText')) }}
@endif @if($component['type'] === 'BUTTONS' && isset($component['buttons']))
@foreach($component['buttons'] as $button) @if($button['type'] === 'URL')
🔗 {{ $button['text'] ?? __('whatsapp::app.button') }}
@elseif($button['type'] === 'QUICK_REPLY')
{{ $button['text'] ?? __('whatsapp::app.quickReply') }}
@elseif($button['type'] === 'PHONE_NUMBER')
📞 {{ $button['text'] ?? __('whatsapp::app.call') }}
@endif @endforeach
@endif @endforeach @endif

{{ __('whatsapp::app.templateDetails') }}

{{ __('whatsapp::app.templateId') }}:

{{ $templatePreview['id'] ?? __('whatsapp::app.na') }}

{{ __('whatsapp::app.name') }}:

{{ $templatePreview['name'] ?? __('whatsapp::app.na') }}

{{ __('whatsapp::app.status') }}:

{{ $templatePreview['status'] ?? __('whatsapp::app.na') }}

{{ __('whatsapp::app.category') }}:

{{ $templatePreview['category'] ?? __('whatsapp::app.na') }}

{{ __('whatsapp::app.language') }}:

{{ strtoupper($templatePreview['language'] ?? 'en') }}

@if(isset($templatePreview['message_send_tolerance']))

{{ __('whatsapp::app.sendTolerance') }}:

{{ $templatePreview['message_send_tolerance'] }}

@endif @if(isset($templatePreview['components']))

{{ __('whatsapp::app.components') }}:

{{ count($templatePreview['components']) }} {{ count($templatePreview['components']) == 1 ? __('whatsapp::app.component') : __('whatsapp::app.componentsPlural') }}

@endif
@endif
@endif
2
{{ $templateDetails['category'] }}

{{ __('whatsapp::app.selectCategory') }}

3
{{ strtoupper($templateDetails['language']) }}

{{ __('whatsapp::app.selectLanguage') }}

@if($templateDetails['header'])
4
@if($templateDetails['header']['text'])
{{ $templateDetails['header']['text'] }}
@if(str_contains($templateDetails['header']['text'], '{{1}}'))

⚠️ {{ __('whatsapp::app.important') }}: {{ __('whatsapp::app.headerCannotStartWithVariable') }} @if(str_starts_with(trim($templateDetails['header']['text']), '{{1}}')) {{ __('whatsapp::app.thisHeaderStartsWithVariable') }} {{ __('whatsapp::app.addStaticTextBeforeVariable') }} Status: {{1}} @else {{ __('whatsapp::app.headerFormatCorrect') }} @endif {{ __('whatsapp::app.remember') }}: {{ __('whatsapp::app.headerVariablesSeparateScope') }}

@endif

{{ __('whatsapp::app.pasteInHeaderField') }}

@endif
@endif @if($templateDetails['body'])
5
{{ $templateDetails['body']['text'] }}

{{ __('whatsapp::app.pasteInBodyField') }}

@if(!empty($templateDetails['variables']))
@php $headerVars = []; $bodyVars = []; $bodyVarCounter = 1; foreach($templateDetails['variables'] as $index => $variable) { if(str_starts_with($variable, 'Header:')) { $headerVars[] = ['varIndex' => 1, 'desc' => str_replace('Header: ', '', $variable)]; } elseif(str_starts_with($variable, 'Body ')) { // Extract body variable index from "Body 1:", "Body 2:", etc. preg_match('/Body (\d+):/', $variable, $matches); $bodyVarIndex = isset($matches[1]) ? (int)$matches[1] : $bodyVarCounter; $bodyVars[] = ['varIndex' => $bodyVarIndex, 'desc' => preg_replace('/Body \d+:\s*/', '', $variable)]; $bodyVarCounter++; } else { // Fallback: assume body variable if no prefix $bodyVars[] = ['varIndex' => $bodyVarCounter, 'desc' => $variable]; $bodyVarCounter++; } } @endphp @if(!empty($headerVars))
@foreach($headerVars as $var)
@php $varNum = $var['varIndex']; $varPlaceholder = '{{' . $varNum . '}}'; @endphp {!! $varPlaceholder !!} {{ $var['desc'] }} {{ __('whatsapp::app.text') }}
@endforeach
@endif @if(!empty($bodyVars))
@foreach($bodyVars as $var)
@php $varNum = $var['varIndex']; $varPlaceholder = '{{' . $varNum . '}}'; @endphp {!! $varPlaceholder !!} {{ $var['desc'] }} {{ __('whatsapp::app.text') }}
@endforeach
@endif

{{ __('whatsapp::app.important') }}: {{ __('whatsapp::app.variablesSeparateScopes') }}

@endif
@endif @if(isset($templateDetails['buttons']) && is_array($templateDetails['buttons']) && count($templateDetails['buttons']) > 0)
6
@foreach($templateDetails['buttons'] as $buttonIndex => $button)
@if($button['type'] === 'QUICK_REPLY') {{ __('whatsapp::app.quickReply') }} @elseif($button['type'] === 'URL') {{ __('whatsapp::app.visitWebsite') }} @elseif($button['type'] === 'PHONE_NUMBER') {{ __('whatsapp::app.callPhoneNumber') }} @elseif($button['type'] === 'OTP') {{ __('whatsapp::app.copyOfferCode') }} @else {{ $button['type'] }} @endif
@if($button['text'])
{{ $button['text'] }}
@endif @if($button['url'])
{{ $button['original_url'] ?? $button['url'] }}
@if(!empty($button['url_variables']))
@foreach($button['url_variables'] as $urlVar)
{!! $urlVar['var'] !!} {{ $urlVar['description'] }} {{ __('whatsapp::app.text') }}
@endforeach

{{ __('whatsapp::app.important') }}: {{ __('whatsapp::app.buttonUrlVariableDescription') }}

@endif @if($button['example'])
{{ $button['example'] }}
@endif
@endif @if($button['phone_number'])
{{ $button['phone_number'] }}
@endif
@endforeach

{{ __('whatsapp::app.addButtonsInOrder') }}

@endif @if($templateDetails['footer'] && $templateDetails['footer']['text'])
7
{{ $templateDetails['footer']['text'] }}

⚠️ {{ __('whatsapp::app.critical') }}: {{ __('whatsapp::app.footerMustBeStatic') }} {{ __('whatsapp::app.footerNoVariablesAllowed') }} {{ __('whatsapp::app.useExactTextNoVariables') }}

{{ __('whatsapp::app.pasteInFooterField') }}

@endif

{{ __('whatsapp::app.reviewAndSubmit') }}

{{ __('whatsapp::app.openMetaPortal') }}
{{ $templateJson }}

{{ __('whatsapp::app.jsonForReference') }}

@elseif($selectedTemplate)

{{ __('whatsapp::app.templateDefinitionNotFound') }}

@endif
@script @endscript