@extends('layouts.app') @section('title', __('whatsappnotification::lang.whatsapp_notification') . ' - ' . __('whatsappnotification::lang.settings')) @section('content')

WhatsApp Connect

Configure Big Brains Flow / Meta Official API once, then use it for POS notifications and B2B customer login OTP.

@component('components.widget', ['class' => 'box-primary']) @slot('title') {{ __('whatsappnotification::lang.whatsapp_notification') }} — {{ __('whatsappnotification::lang.settings') }} @endslot @slot('tool') {{ __('whatsappnotification::lang.manage_templates') }} {{ __('whatsappnotification::lang.notification_logs') }} @endslot @if(session('status')) @if(session('status.success'))
{{ session('status.msg') }}
@else
{{ session('status.msg') }}
@endif @endif

B2B Portal Login OTP Setup

For B2B customer authentication, create one active template in Manage Templates with these exact settings:

  1. Template Name: B2B Login OTP
  2. Trigger Type: Manual
  3. Send via: Meta Official Cloud API
  4. Approved Meta Template: choose your approved OTP template from Meta
  5. Body Parameters: add {otp} on its own line
  6. Active: checked
Create B2B Login OTP Template
{{-- WhatsApp Connection Panel --}}

WhatsApp Connection

Use the buttons below to connect your WhatsApp account to this instance. Save your Access Token and API URL first, then click Create Instance if you don't have an Instance ID yet, or Get QR Code to scan with WhatsApp.

{!! Form::open(['route' => 'whatsappnotification.save_settings', 'method' => 'POST']) !!} {{-- API Configuration --}}

{{ __('whatsappnotification::lang.api_configuration') }}


{!! Form::label('api_url', __('whatsappnotification::lang.api_url') . ':') !!} {!! Form::text('api_url', $settings->api_url, ['class' => 'form-control', 'placeholder' => 'https://multicrm.bigbrainscrm.com/api/send_template']) !!}
{!! Form::label('instance_id', __('whatsappnotification::lang.instance_id') . ':') !!} {!! Form::text('instance_id', $settings->instance_id, ['class' => 'form-control', 'required', 'placeholder' => 'Your Instance ID']) !!}
{!! Form::label('access_token', __('whatsappnotification::lang.access_token') . ':') !!} {!! Form::text('access_token', $settings->access_token, ['class' => 'form-control', 'required', 'placeholder' => 'Your Access Token']) !!}

Meta Official Cloud API (optional — per-template opt-in)

Set these to enable the Meta Official Cloud API path. In each Template you can then choose which provider (unofficial / Meta) to use for that trigger. Get your key from API Keys in the MultiCRM sidebar; the Connection ID is from the Connections page.

{!! Form::label('meta_api_key', 'Meta API Key:') !!} {!! Form::text('meta_api_key', $settings->meta_api_key ?? '', ['class' => 'form-control', 'placeholder' => 'mck_live_...']) !!}
{!! Form::label('meta_connection_id', 'Meta Connection ID:') !!} {!! Form::text('meta_connection_id', $settings->meta_connection_id ?? '', ['class' => 'form-control', 'placeholder' => 'e.g. 12']) !!}

{!! Form::label('type', __('whatsappnotification::lang.message_type') . ':') !!} {!! Form::select('type', ['button' => 'Button', 'list' => 'List'], $settings->type, ['class' => 'form-control']) !!}
{{-- Message Template --}}

{{ __('whatsappnotification::lang.message_template') }}


{!! Form::label('message_title', __('whatsappnotification::lang.message_title') . ':') !!} {!! Form::textarea('message_title', $settings->message_title, ['class' => 'form-control', 'rows' => 5, 'placeholder' => 'Thank you for your order #{invoice_no}! Your total is ₹{total_amount}.']) !!}
{!! Form::label('message_footer', __('whatsappnotification::lang.message_footer') . ':') !!} {!! Form::text('message_footer', $settings->message_footer, ['class' => 'form-control', 'placeholder' => '{business_name} - {business_phone}']) !!}
{{ __('whatsappnotification::lang.available_tags') }}

{{ __('whatsappnotification::lang.tags_help') }}

{invoice_no} — Invoice Number
{invoice_url} — Invoice URL (public link)
{invoice_pdf_url} — Invoice PDF URL
{total_amount} — Total Amount
{total_paid} — Total Paid
{total_due} — Total Due
{contact_name} — Customer Name
{customer_mobile} — Customer Mobile
{business_name} — Business Name
{business_phone} — Business Phone
{transaction_date} — Transaction Date
{product_list} — Product List
{item_count} — Total Items
{discount} — Discount
{tax} — Tax Amount
{shipping} — Shipping
{sale_note} — Sale Note
{payment_status} — Payment Status
{{-- Template Buttons --}}

{{ __('whatsappnotification::lang.template_buttons') }}

{{ __('whatsappnotification::lang.template_buttons_help') }}


@php $buttons = $settings->template_buttons ?? []; // Normalize old format (keyed by type) to new format (indexed array) if (!empty($buttons) && !isset($buttons[0])) { $normalized = []; foreach ($buttons as $type => $btn) { $btn['type'] = $type; $normalized[] = $btn; } $buttons = $normalized; } @endphp
@foreach($buttons as $index => $btn)
@if(($btn['type'] ?? 'urlButton') == 'urlButton')
@elseif(($btn['type'] ?? '') == 'callButton')
@elseif(($btn['type'] ?? '') == 'quickReplyButton')
@elseif(($btn['type'] ?? '') == 'copyCodeButton')
@endif
@endforeach
You can add up to 3 buttons per message
{{-- Trigger Settings --}}

{{ __('whatsappnotification::lang.trigger_settings') }}


{{-- Master Switch --}}

{{ __('whatsappnotification::lang.enable_module_help') }}


{{-- Auto Notification Triggers --}}
{{ __('whatsappnotification::lang.auto_notification_triggers') }}

{{ __('whatsappnotification::lang.auto_trigger_help') }}

{{ __('whatsappnotification::lang.notify_on_new_sale_help') }}

{{ __('whatsappnotification::lang.notify_on_sale_update_help') }}

{{ __('whatsappnotification::lang.how_it_works') }}: {{ __('whatsappnotification::lang.how_it_works_desc') }}

{{-- Test Notification --}}

{{ __('whatsappnotification::lang.test_notification') }}




{!! Form::close() !!}
WhatsApp Connect v{{ config('whatsappnotification.module_version', '1.0') }} — {{ __('whatsappnotification::lang.powered_by') }} | bigbrainstechnolabs.com
@endcomponent @stop @section('javascript') @endsection