@extends('layouts.app', ['title' => __tr('Edit Template')]) @section('content') @include('users.partials.header', [ 'title' => __tr('Edit Template'), 'description' => '', 'class' => 'col-lg-7' ])
@php $templateComponents = $whatsAppTemplateData['components']; $templateButtons = Arr::first($templateComponents, function ($value, $key) { return $value['type'] == 'BUTTONS'; }); @endphp
index + 1 }}' : { buttonType : '{{ $templateComponentButton['type'] }}', buttonIndex : {{ $loop->index + 1 }} }, @endforeach @endif }, }, addWhatsAppButtonOption : function(buttonType) { {{-- let uniqueBtnId = _.uniqueId(); --}} let uniqueBtnId = _.size(this.customButtons.data) + 1; this.customButtons.data[uniqueBtnId] = { buttonType : buttonType, buttonIndex : uniqueBtnId }; this.buttonModels[uniqueBtnId] = { 'text_value': '', 'example_value': '', }; this.customButtons.totalButtonsUsed++; if((buttonType == 'URL_BUTTON') || (buttonType == 'DYNAMIC_URL_BUTTON')) { this.customButtons.buttonUsesByTypes['URL_BUTTON']++; } else if((buttonType == 'COPY_CODE')) { this.customButtons.buttonUsesByTypes['COPY_CODE']++; } else if((buttonType == 'VOICE_CALL')) { this.customButtons.buttonUsesByTypes['VOICE_CALL']++; } else if((buttonType == 'PHONE_NUMBER')) { this.customButtons.buttonUsesByTypes['PHONE_NUMBER']++; } }, deleteWhatsAppButtonOption : function(buttonIndex) { let buttonType = this.customButtons.data[buttonIndex]['buttonType']; if((buttonType == 'URL_BUTTON') || (buttonType == 'DYNAMIC_URL_BUTTON')) { this.customButtons.buttonUsesByTypes['URL_BUTTON']--; } else if((buttonType == 'COPY_CODE')) { this.customButtons.buttonUsesByTypes['COPY_CODE']-- ; } else if((buttonType == 'VOICE_CALL')) { this.customButtons.buttonUsesByTypes['VOICE_CALL']-- ; } else if((buttonType == 'PHONE_NUMBER')) { this.customButtons.buttonUsesByTypes['PHONE_NUMBER']-- ; } delete this.customButtons.data[buttonIndex]; delete this.buttonModels[buttonIndex]; this.customButtons.totalButtonsUsed--; }}">
{{ __tr('Template Info') }}
{{ __tr('Name') }}
{{ $whatsAppTemplateData['name'] }}
{{ __tr('Language') }}
{{ $whatsAppTemplateData['language'] }}
{{ __tr('Category') }}
{{ $whatsAppTemplateData['category'] }}
{{ __tr('Status') }}
@if ($whatsAppTemplateData['status'] == 'APPROVED') @elseif ($whatsAppTemplateData['status'] == 'REJECTED') @elseif ($whatsAppTemplateData['status'] == 'PENDING') @endif {{ $whatsAppTemplateData['status'] }}
{{-- OTP and flow templates --}} @if ((($whatsAppTemplateData['sub_category'] ?? null) == 'FORM') or (($whatsAppTemplateData['category'] ?? null) == 'AUTHENTICATION'))
{{ __tr('You need to edit this template on Meta') }}
{{ __tr('Edit this Template on Meta') }}
@else
@php $headerSelected = null; @endphp @foreach ($templateComponents as $templateComponent) @if ($templateComponent['type'] == 'HEADER') @php $headerSelected = strtolower($templateComponent['format']); @endphp @break @endif @endforeach {{ __tr('Header') }} {{ __tr('(Optional)') }}
{{-- text --}}
{{-- document --}}

{{ __tr('Sample Document') }}