@extends('layouts.app') @section('title', 'SMS & WhatsApp') @section('page-title', 'Notifications') @section('content')
{{-- Header --}}

SMS & WhatsApp

Send notifications to students, parents, and teachers

@if($smsEnabled) {{ ucfirst($provider) }} Connected @else Log Mode (Configure .env) @endif
{{-- Stats --}}

{{ $stats['students_with_phone'] }}

Students with phone ({{ $stats['total_students'] }} total)

{{ $stats['parents_with_phone'] }}

Parents with phone ({{ $stats['total_parents'] }} total)

{{ $stats['teachers_with_phone'] }}

Teachers with phone ({{ $stats['total_teachers'] }} total)

{{-- Send Message Form --}}
@csrf

Compose Message

{{-- Audience --}}
@foreach([ 'all_parents' => ['Parents (All)', 'fa-user-friends', 'amber'], 'all_students' => ['Students (All)', 'fa-user-graduate', 'blue'], 'all_teachers' => ['Teachers (All)', 'fa-chalkboard-teacher', 'green'], 'class_students' => ['Class Students', 'fa-users', 'purple'], 'class_parents' => ['Class Parents', 'fa-users', 'pink'], 'custom' => ['Custom Numbers', 'fa-phone-alt', 'stone'], ] as $val => [$label, $icon, $color]) @endforeach
{{-- Class selector --}}
{{-- Custom phones --}}
{{-- Channel --}}
{{-- Message --}}

0/1000 characters

{{-- Quick Templates --}}
@foreach([ 'Holiday Notice' => 'Dear Parents, please note that the school will remain closed on [DATE] for [REASON]. Classes resume on [DATE].', 'PTM Reminder' => 'Dear Parents, Parent-Teacher Meeting is scheduled for [DATE] at [TIME]. Please book your slots on the portal.', 'Fee Reminder' => 'Dear Parents, this is a gentle reminder that the fee for [TERM] is due on [DATE]. Please clear the dues at the earliest.', 'Exam Schedule' => 'Dear Students, exams begin from [DATE]. Please check the timetable on the portal and prepare well.', 'Event Notice' => 'Dear Parents, [EVENT NAME] will be held on [DATE] at [VENUE]. All are welcome to attend.', ] as $name => $template) @endforeach
{{-- Send --}}
@if(!$smsEnabled)

Messages will be logged only. Enable SMS in .env to send real messages.

@else

Connected via {{ ucfirst($provider) }}

@endif
{{-- Setup Guide --}} @if(!$smsEnabled)

Setup Guide

Choose Provider

Add to .env:

SMS_ENABLED=true
SMS_PROVIDER=msg91  # or 'twilio'

MSG91 Setup

MSG91_AUTH_KEY=your_auth_key
MSG91_SENDER_ID=SCHOOL
MSG91_ROUTE=4

Twilio Setup

TWILIO_SID=your_account_sid
TWILIO_TOKEN=your_auth_token
TWILIO_FROM=+1234567890
@endif
@endsection