@extends('layouts.admin.app',['page' => $menuAdmin['settings']['active'] ?? "", 'sub_page' => 'whatsapp' ]) @section('title', 'WhatsApp Settings') @section('header_data') @php $page_title = 'WhatsApp Settings'; $page_pretitle = __('labels.admin') . " " . __('labels.settings'); @endphp @endsection @php $breadcrumbs = [ ['title' => __('labels.home'), 'url' => route('admin.dashboard')], ['title' => __('labels.settings'), 'url' => route('admin.settings.index')], ['title' => 'WhatsApp Settings', 'url' => null], ]; $infoButton = fn (string $message) => ''; @endphp @section('admin-content')
@csrf @foreach(($settings['abandonedCartNotificationChannels'] ?? ['push']) as $channel) @endforeach

Meta API Credentials

Webhook Setup

Template Mapping

Statuses are synced from Meta. Only approved and active templates are used for sending.
@foreach($whatsAppTemplateModules ?? [] as $moduleKey => $moduleConfig) @php $template = ($whatsAppTemplates ?? collect())->get($moduleKey); $format = old("templates.$moduleKey.parameter_format", $template?->parameter_format ?? 'positional'); $variables = old("templates.$moduleKey.variables", json_encode($template?->variables ?: \App\Support\WhatsAppTemplateCatalog::defaultVariables($moduleKey, $format), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); @endphp @endforeach
Module {!! $infoButton('The app event that can trigger a WhatsApp message, such as order placed or invoice delivered.') !!} Template {!! $infoButton('Exact approved template name from Meta. Use the template name, not the display title.') !!} Language {!! $infoButton('Language code used by the Meta template, for example en_US. It must match a language approved in Meta.') !!} Format {!! $infoButton('Positional maps Meta variables like {{1}} and {{2}}. Named maps variables like {{customer_name}} and {{order_number}}.') !!} Meta Status {!! $infoButton('Read-only status synced from Meta. Only Approved templates are used for sending.') !!} Active {!! $infoButton('Enables this module/template mapping in this app. It must be active and approved to send.') !!} Variables Mapping {!! $infoButton('Maps each Meta variable to an app data field. JSON is stored for flexibility across positional and named templates.') !!} Sync {!! $infoButton('Fetch latest Meta status and template details for this configured row only.') !!}
{{ $moduleConfig['label'] }}
{{ $moduleConfig['audience'] }} ยท {{ $moduleKey }}
Triggered by this app event.
template_name) }}" placeholder="meta_template_name"> Paste from Meta. language ?? ($settings['whatsappDefaultLanguage'] ?? 'en_US')) }}"> Example: en_US. Positional: @{{1}}. Named: @{{name}}. @php $status = $template?->status ?? 'draft'; $statusColor = match ($status) { 'approved' => 'success', 'rejected' => 'danger', 'paused' => 'warning', 'submitted' => 'info', default => 'secondary', }; @endphp {{ ucfirst($status) }} @if($template?->quality_score)
Quality: {{ $template->quality_score }}
@endif @if($template?->category)
Category: {{ $template->category }}
@endif @if($template?->rejected_reason)
Rejected: {{ $template->rejected_reason }}
@endif @if($template?->last_synced_at)
Synced: {{ $template->last_synced_at->diffForHumans() }}
@else
Not synced yet.
@endif @if($template?->sync_error)
{{ \Illuminate\Support\Str::before($template->sync_error, ' Fetched from Meta:') }}
@endif
Use this mapping. Allowed app fields: {{ implode(', ', $moduleConfig['variables']) }}

Send Test Template {!! $infoButton('Sends the selected approved active module template to the test number with sample values, so credentials and mappings can be verified.') !!}

@endsection @push('scripts') @endpush