{{ __('Templates / New') }}
{{ __('Create message') }} {{ __('template') }}
{{ __('Standard') }} {{ __('Draft / unsaved') }}
@if ($errors->any())
{{ __('Could not save the template:') }}
    @foreach ($errors->all() as $msg)
  • {{ $msg }}
  • @endforeach
@endif
@csrf
01 {{ __('Identity') }} {{ __('required') }}
{{ __('a-z, 0-9, _ only / max 60.') }}
{{-- Meta-approved category drives the review path. The separate `category` (industry tag, default utility) is sent as a hidden input so the controller's validate('in:travel,…,utility') still passes without the operator picking. --}}
{{ __('Determines Meta review path.') }}
{{ __('One locale per template.') }}
{{-- Twilio ContentSid: optional per-template pointer to a Twilio Content Builder template (HX...). When set, Twilio sends use the approved-template path (compliant for MARKETING / UTILITY / AUTHENTICATION categories) instead of plain Body text. Leave blank for Baileys-only / WABA-only workspaces. Only shown when the workspace's active engine is Twilio. --}} @if ($isTwilio ?? false)
{{ __('Paste the HX… ContentSid from Twilio Content Builder. Required for compliant Twilio sends of MARKETING / UTILITY / AUTHENTICATION templates.') }}
@endif
02 {{ __('Header') }} {{ __('optional') }}
03 {{ __('Body') }} {{ __('required') }} / 0/1024
B I S ‹› {{-- Named-only authoring: this pill opens the `/` attribute picker on the body so the operator inserts a NAMED token ({{name}}) — the server normalizes it to positional {{1}} on save. (Replaces the old {{1}}–{{4}} numbered chips.) --}} {{ __('Variable') }} 0/1024
{{-- Empty by default — the example used to live inside the textarea, which meant submitting without any edits silently sent that placeholder copy. Moved to the `placeholder` attr so the body is real. --}}
{{-- Variable mapping — records WHICH attribute each positional placeholder ({{1}}, {{2}}, …) resolves to at send time. The hidden `variable_map_json` field carries the { slot: attribute_key } object the controller turns into `variable_map`. The attribute-picker (`/` in the body) writes here too via the `data-attr-map` wrapper. The visible panel below is populated by user-templates-create.js from the placeholders currently in the body. --}} {{-- Panel hidden: named tokens ({{company}}) already name their attribute, so a manual slot→attribute map is redundant (and its auto-guess could show a wrong attribute). The server derives variable_map from the token names on save. The hidden field above is kept for the legacy positional path. --}}
{{ __('Markdown:') }} *bold* _italic_ ~strike~ ```code```
04 {{ __('Attachment') }} {{ __('optional / image, video, or PDF') }}
{{ __('Choose sample file') }}
{{ __('required by Meta for media templates') }}
{{ __('Browse') }}
05 {{ __('Footer') }} {{ __('optional / max 60') }}
{{ __('Plain text under the body. No variables.') }}
06 {{ __('Buttons') }} {{ __('optional / up to 10') }}
{{ __('Call to action') }} {{ __('Quick reply') }} {{ __('Mix') }}
{{-- Static seed row — operators usually want at least one CTA. Names match the controller's processButtons() input arrays. --}}
{{-- The "Interactive (List menu / Poll)" section that lived here was removed — those controls aren't part of the WhatsApp Business template surface and were confusing operators. Buttons + Quick replies remain in section 06 above and cover every interactive option that's actually supported. --}}
{{-- Build-with-AI modal — vanilla Tailwind, same overlay/panel pattern as /templates#type-modal so the visual language stays consistent. Opened by #open-ai-modal in the sticky bar above. POST submission lives in user-templates-create.js. --}}