======================================== LaDMA NOTIFICATION SYSTEM - READY ======================================== ✓ SMS Notifications - READY ✓ Email Notifications - READY ✓ All 4 Entry Types Configured: - Business Permit - Property Rate - Signage Permit - Ground Rent ======================================== QUICK START ======================================== Windows: -------- start-notifications.bat Linux/Mac: ---------- chmod +x start-notifications.sh ./start-notifications.sh Or manually: ------------ php artisan config:clear php artisan queue:work --queue=notifications --tries=3 --timeout=60 ======================================== CONFIGURATION ======================================== SMS (in .env): -------------- SMS_HOST=api.smsonlinegh.com SMS_API_KEY=888a6e70596fe2f0fd5224d12420aa362e84f99ee85571728b44bb5355b3fcf8 SMS_SENDER_ID=LaDMA Email (in .env): ---------------- MAIL_MAILER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=dickson.awudu@shrinqghana.com MAIL_PASSWORD=yktmmnjwhruucbsr MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=noreply@RevenueAssurance.com MAIL_FROM_NAME="LaDMA Revenue System" ======================================== HOW IT WORKS ======================================== When you create a new entry (Business Permit, Property Rate, etc.): 1. Entry is saved to database 2. Entry is linked to ratepayer 3. SMS job is queued → "notifications" queue 4. Email job is queued → "notifications" queue 5. Queue worker processes both jobs 6. Ratepayer receives SMS and Email ======================================== NOTIFICATION CONTENT ======================================== SMS Message: ------------ New [Entry Type] added: [Business Name] (Ref: [Reference]). Amount: GHS [Amount]. Login at portal.revenue.gov.gh to view and pay. - LaDMA Email Subject: -------------- New [Entry Type] Added - LaDMA Revenue System Email Content: -------------- HTML formatted email with: - Greeting with ratepayer name - Entry details table - Amount due - Login button - LaDMA branding ======================================== TESTING ======================================== 1. Start queue worker: start-notifications.bat (Windows) OR ./start-notifications.sh (Linux/Mac) 2. Create a test entry via API 3. Check logs: tail -f storage/logs/laravel.log 4. Verify: - SMS received on phone - Email received in inbox ======================================== MONITORING ======================================== View queued jobs: ----------------- php artisan queue:monitor View failed jobs: ----------------- php artisan queue:failed Retry failed jobs: ------------------ php artisan queue:retry all Restart workers: ---------------- php artisan queue:restart ======================================== PRODUCTION SETUP ======================================== Use Supervisor to keep queue worker running: [program:ladma-notifications] command=php /path/to/backend_api/artisan queue:work --queue=notifications --tries=3 --timeout=60 autostart=true autorestart=true user=www-data numprocs=2 redirect_stderr=true stdout_logfile=/path/to/backend_api/storage/logs/queue-worker.log ======================================== TROUBLESHOOTING ======================================== SMS not sending? ---------------- - Check SMS_API_KEY in .env - Check SMS credits (309 available) - Check phone number format - Check logs for errors Email not sending? ------------------ - Check MAIL_* settings in .env - Check Gmail app password is correct - Check email address is valid - Check logs for errors Queue not processing? --------------------- - Ensure queue worker is running - Check QUEUE_CONNECTION=database in .env - Run: php artisan queue:work ======================================== FILES UPDATED ======================================== ✓ .env - Added MAIL_* configuration ✓ .env.example - Updated mail config ✓ app/Jobs/SendEntryNotificationEmail.php - Updated to LaDMA branding ✓ start-notifications.sh - Linux/Mac startup script ✓ start-notifications.bat - Windows startup script All 4 controllers already configured: ✓ EntryController.php (Business Permit) ✓ PropertyEntryController.php (Property Rate) ✓ SignageEntryController.php (Signage Permit) ✓ GroundRentEntryController.php (Ground Rent) ======================================== READY TO USE! ======================================== Just run: start-notifications.bat (Windows) OR: ./start-notifications.sh (Linux/Mac) Then create entries and watch notifications go out! ========================================