<div class="tab-pane fade" id="notifications" role="tabpanel">
    <div class="card">
        <div class="card-header">
            <h5 class="card-title mb-0">Notification Templates</h5>
        </div>
        <div class="card-body">
            <p class="text-muted mb-4">
                Configure email and SMS (WhatsApp API) templates for major events. Turn each channel off to stop sending for that event.
                SMS uses the WhatsApp API configured under the WhatsApp tab.
            </p>

            <div class="accordion" id="notification-events">
                <?php $__currentLoopData = $notificationEvents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $eventKey => $eventConfig): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $values = $notificationSettings[$eventKey] ?? [];
                    ?>
                    <div class="accordion-item">
                        <h2 class="accordion-header" id="heading-<?php echo e($eventKey); ?>">
                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
                                    data-bs-target="#collapse-<?php echo e($eventKey); ?>" aria-expanded="false"
                                    aria-controls="collapse-<?php echo e($eventKey); ?>">
                                <?php echo e($eventConfig['label'] ?? $eventKey); ?>

                            </button>
                        </h2>
                        <div id="collapse-<?php echo e($eventKey); ?>" class="accordion-collapse collapse"
                             aria-labelledby="heading-<?php echo e($eventKey); ?>" data-bs-parent="#notification-events">
                            <div class="accordion-body">
                                <?php if(! empty($eventConfig['description'])): ?>
                                    <p class="text-muted small"><?php echo e($eventConfig['description']); ?></p>
                                <?php endif; ?>

                                <?php if(! empty($eventConfig['placeholders'])): ?>
                                    <p class="small mb-3">
                                        <strong>Placeholders:</strong>
                                        <?php $__currentLoopData = $eventConfig['placeholders']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $placeholder): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <code class="me-1"><?php echo e($placeholder); ?></code>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </p>
                                <?php endif; ?>

                                <div class="row g-3">
                                    <div class="col-12">
                                        <div class="form-check form-switch">
                                            <input class="form-check-input" type="checkbox"
                                                   name="notifications[<?php echo e($eventKey); ?>][email_enabled]" value="1"
                                                   id="notifications_<?php echo e($eventKey); ?>_email_enabled"
                                                   <?php if(old("notifications.{$eventKey}.email_enabled", $values['email_enabled'] ?? false)): echo 'checked'; endif; ?>>
                                            <label class="form-check-label" for="notifications_<?php echo e($eventKey); ?>_email_enabled">
                                                Send email for this event
                                            </label>
                                        </div>
                                    </div>
                                    <div class="col-12">
                                        <label class="form-label" for="notifications_<?php echo e($eventKey); ?>_email_subject">Email subject</label>
                                        <input type="text" class="form-control"
                                               name="notifications[<?php echo e($eventKey); ?>][email_subject]"
                                               id="notifications_<?php echo e($eventKey); ?>_email_subject"
                                               value="<?php echo e(old("notifications.{$eventKey}.email_subject", $values['email_subject'] ?? '')); ?>">
                                    </div>
                                    <div class="col-12">
                                        <label class="form-label" for="notifications_<?php echo e($eventKey); ?>_email_body">Email body</label>
                                        <textarea class="form-control" rows="5"
                                                  name="notifications[<?php echo e($eventKey); ?>][email_body]"
                                                  id="notifications_<?php echo e($eventKey); ?>_email_body"><?php echo e(old("notifications.{$eventKey}.email_body", $values['email_body'] ?? '')); ?></textarea>
                                    </div>

                                    <div class="col-12"><hr class="my-1"></div>

                                    <div class="col-12">
                                        <div class="form-check form-switch">
                                            <input class="form-check-input" type="checkbox"
                                                   name="notifications[<?php echo e($eventKey); ?>][sms_enabled]" value="1"
                                                   id="notifications_<?php echo e($eventKey); ?>_sms_enabled"
                                                   <?php if(old("notifications.{$eventKey}.sms_enabled", $values['sms_enabled'] ?? false)): echo 'checked'; endif; ?>>
                                            <label class="form-check-label" for="notifications_<?php echo e($eventKey); ?>_sms_enabled">
                                                Send SMS for this event
                                            </label>
                                        </div>
                                    </div>
                                    <div class="col-12">
                                        <label class="form-label" for="notifications_<?php echo e($eventKey); ?>_sms_body">SMS message</label>
                                        <textarea class="form-control" rows="3"
                                                  name="notifications[<?php echo e($eventKey); ?>][sms_body]"
                                                  id="notifications_<?php echo e($eventKey); ?>_sms_body"><?php echo e(old("notifications.{$eventKey}.sms_body", $values['sms_body'] ?? '')); ?></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    </div>
</div>
<?php /**PATH D:\RABI\rabi\module-laravel-platform\apps\admin\resources\views/settings/partials/notifications.blade.php ENDPATH**/ ?>