# Enhanced Admin Panel - Notification Settings Guide
## 🎯 Overview
The admin panel has been enhanced with comprehensive notification settings that allow you to configure every aspect of your booking reminder system and other notifications through an intuitive interface.
## 📋 New Settings Added
### 🔄 **Booking Reminder Periods**
Configure multiple reminder periods for bookings:
- **7 days** (168 hours)
- **3 days** (72 hours)
- **2 days** (48 hours)
- **1 day** (24 hours)
- **12 hours**
- **6 hours**
- **3 hours**
- **1 hour**
### 📡 **Notification Channels**
Set delivery channels for each notification type:
- **Email** (`mail`)
- **SMS** (`sms`)
- **In-App** (`database`)
- **GatewayAPI** (`gatewayapi`)
### ⚡ **Performance Settings**
Configure system performance and limits:
- **Rate limiting** for emails and SMS
- **Queue configuration** for processing
- **Default user preferences**
## 🚀 Accessing the Settings
1. **Login to Admin Panel**
2. **Navigate to Settings → Notification Settings**
3. **Choose the appropriate tab**
## 📑 Tab Overview
### **1. General Settings**
- Enable/disable notification channels
- Configure email and SMS settings
- Set up GatewayAPI integration
### **2. Booking Notifications** ⭐ *Enhanced*
- **Reminder Periods**: Select multiple reminder times
- **Notification Channels**: Configure channels per notification type
- **Urgent Notifications**: Set channels for critical updates
### **3. Payment Notifications**
- Payment confirmation settings
- Retry configurations
- Failure thresholds
### **4. Account Notifications**
- Welcome emails
- Password reset settings
- Account update notifications
### **5. Admin Notifications**
- Revenue reports
- System alerts
- Admin recipient lists
### **6. Marketing Notifications**
- Promotional offers
- New venue announcements
- Seasonal campaigns
### **7. Contact Information**
- Support email
- Support phone
- Contact details
### **8. Performance & Preferences** ⭐ *New*
- **Rate Limiting**: Prevent spam
- **Queue Configuration**: Optimize performance
- **Default User Preferences**: Set defaults for new users
### **9. Notification Templates**
- Preview all email templates
- Customize content
- Test in multiple languages
## ⚙️ Key Configuration Options
### **Booking Reminder Periods**
```
☑ 3 days (72 hours) ☑ 1 day (24 hours)
☐ 7 days (168 hours) ☐ 12 hours
☐ 2 days (48 hours) ☐ 6 hours
☐ 3 hours
☐ 1 hour
```
### **Notification Channels**
```
Booking Confirmation: ☑ Email ☐ SMS ☑ In-App ☐ GatewayAPI
Booking Cancellation: ☑ Email ☐ SMS ☑ In-App ☐ GatewayAPI
Account Updates: ☑ Email ☐ SMS ☑ In-App ☐ GatewayAPI
```
### **Rate Limiting**
```
Email Rate Limit: 10 per hour (1-100)
SMS Rate Limit: 5 per hour (1-50)
```
### **Queue Configuration**
```
Queue Connection: Redis (Default/Redis/Database/Sync)
Queue Name: notifications
```
### **Default User Preferences**
```
Email Reminders: ☑ Enabled
SMS Reminders: ☑ Enabled
Marketing Emails: ☐ Disabled
```
## 🎛️ Advanced Configuration
### **Multiple Reminder Periods**
1. Go to **Booking Notifications** tab
2. Scroll to **Booking Reminder Periods** section
3. Select all desired periods
4. Click **Save**
### **Channel-Specific Delivery**
1. In **Booking Notifications** tab
2. Find **Notification Channels** section
3. Configure channels per notification type
4. Click **Save**
### **Performance Optimization**
1. Go to **Performance & Preferences** tab
2. Adjust **Rate Limiting** values
3. Configure **Queue Settings**
4. Set **Default User Preferences**
5. Click **Save**
## 📊 Impact on Reminder System
### **When You Change Settings:**
#### **Reminder Periods**
- ✅ **Immediate effect** for new bookings
- ✅ **Job scheduler** uses new periods on next run
- ✅ **No restart required**
#### **Notification Channels**
- ✅ **Immediate effect** for all new notifications
- ✅ **Respects user preferences**
- ✅ **Fallback to default if channel fails**
#### **Rate Limiting**
- ✅ **Immediate protection** against spam
- ✅ **Per-user tracking** automatically enabled
- ✅ **Graceful handling** of limit exceeded
#### **Queue Settings**
- ⚠️ **Queue restart** may be required
- ✅ **New jobs** use new configuration
- ✅ **Existing jobs** continue with old settings
## 🔧 Testing Your Configuration
### **Test Reminder Periods**
```bash
# Dry run to test new periods
php artisan bookings:send-reminders --dry-run
# Test specific periods
php artisan bookings:send-reminders --periods=72,24 --dry-run
```
### **Test Notification Channels**
```bash
# Test specific booking
php artisan tinker
>>> $booking = App\Models\Booking::find(1);
>>> $booking->user->notify(new App\Notifications\BookingReminderNotification(
... $booking->user, $booking, '123456', 24
... ));
```
### **Verify Settings in Database**
```bash
php artisan tinker
>>> setting('booking_reminder_periods', 'notifications');
>>> setting('booking_confirmation_channels', 'notifications');
>>> setting('rate_limit_emails', 'notifications');
```
## 📱 User Experience Impact
### **For Customers**
- **More reminders** = Better attendance rates
- **Channel choice** = Preferred communication method
- **Consistent timing** = Reliable experience
### **For Administrators**
- **Centralized control** = Easy management
- **Real-time updates** = Immediate effect
- **Performance monitoring** = System health
### **For the System**
- **Rate limiting** = Prevents abuse
- **Queue processing** = Better performance
- **Default preferences** = Consistent onboarding
## 🚨 Important Notes
### **Rate Limiting**
- **Per-user basis** - Limits apply to individual users
- **Sliding window** - Counts last hour of activity
- **Graceful handling** - Users notified when limits reached
### **Queue Configuration**
- **Redis recommended** for production
- **Database** for development/testing
- **Sync** for debugging only (no background processing)
### **Channel Priority**
1. **Email** - Primary channel
2. **SMS** - Time-sensitive notifications
3. **In-App** - Secondary confirmation
4. **GatewayAPI** - SMS fallback
## 🎯 Best Practices
### **Reminder Periods**
- **Start with**: 72h and 24h periods
- **Add more**: Based on customer feedback
- **Monitor**: No-show rates and customer satisfaction
### **Rate Limits**
- **Email**: 10-20 per hour for most businesses
- **SMS**: 5-10 per hour to control costs
- **Adjust**: Based on your volume and needs
### **Queue Settings**
- **Production**: Redis with dedicated queue
- **Staging**: Database or Redis
- **Development**: Sync for immediate feedback
### **User Preferences**
- **Opt-in** for marketing communications
- **Opt-out** always available
- **Respect** user choices at all times
## 🔄 Maintenance
### **Regular Checks**
1. **Monitor queue processing** times
2. **Check rate limit** effectiveness
3. **Review user feedback** on timing
4. **Update periods** based on seasonality
### **Performance Monitoring**
```bash
# Check queue performance
php artisan queue:monitor notifications
# Check failed jobs
php artisan queue:failed
# Clear stuck jobs
php artisan queue:clear notifications
```
### **Settings Backup**
```bash
# Export current settings
php artisan tinker
>>> $settings = DB::table('settings')->where('group', 'notifications')->get();
>>> file_put_contents('notification_settings_backup.json', $settings->toJson());
```
Your enhanced admin panel now provides complete control over the notification system with an intuitive interface for managing all aspects of booking reminders and other communications! 🎉