Email Notifications
Email notifications are the primary notification channel in LIVCK. When properly configured, team members receive email notifications for alerts, incidents, maintenance windows, and announcements.
Overview
LIVCK uses Laravel's built-in mail system to send email notifications. You can configure any SMTP-compatible email service or mail server to deliver notifications to your team members.
Choosing an Email Provider
For Basic Usage:
- Use any standard SMTP server
- Good for small teams and low-volume notifications
- Simple setup with SMTP credentials
For High Volume (Recommended):
- Use Amazon SES for large-scale deployments
- Better deliverability and reliability
- Cost-effective for high message volumes
- Advanced features like bounce handling and analytics
Configuration
Email notifications are configured at the system level using environment variables in your .env
file.
Required Environment Variables
Add the following configuration to your .env
file:
MAIL_MAILER="smtp"
MAIL_HOST="127.0.0.1"
MAIL_PORT="25"
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
Configuration Parameters
Parameter | Description | Example |
---|---|---|
MAIL_MAILER | Mail driver to use | smtp , sendmail , mailgun , ses |
MAIL_HOST | SMTP server hostname | mail.example.com |
MAIL_PORT | SMTP server port | 25 , 465 , 587 , 2525 |
MAIL_USERNAME | SMTP authentication username | [email protected] |
MAIL_PASSWORD | SMTP authentication password | Your SMTP password |
MAIL_FROM_ADDRESS | Sender email address | [email protected] |
MAIL_FROM_NAME | Sender name | LIVCK Status Page |
Common SMTP Providers
Amazon SES (Recommended for High Volume)
MAIL_MAILER="ses"
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_DEFAULT_REGION=us-east-1
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
Mailgun
MAIL_MAILER="mailgun"
MAILGUN_DOMAIN=your-domain.com
MAILGUN_SECRET=your-api-key
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
Custom SMTP Server
MAIL_MAILER="smtp"
MAIL_HOST="mail.your-domain.com"
MAIL_PORT="587"
MAIL_ENCRYPTION="tls"
MAIL_USERNAME=smtp-user
MAIL_PASSWORD=smtp-password
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
User Configuration
Once email is configured at the system level, each team member needs to set their email address in their profile.
Setting Up Email Notifications
- Navigate to
/user/profile
- Enter your Email address
- Click Save
- Click Test all configured Notification-Channels to verify email delivery
Testing Email Notifications
After configuring email settings:
- Log in as a member
- Go to
/user/profile
- Ensure your email address is set
- Click the Test all configured Notification-Channels button
- Check your inbox for the test email
If you don't receive the test email, check:
- SMTP credentials are correct
- SMTP server is accessible from your server
- Firewall allows outbound connections on the SMTP port
- Email isn't in spam/junk folder
- Application logs for error messages:
docker-compose logs app
Notification Triggers
Members receive email notifications for:
- New Alerts - When new announcements, incidents, or maintenance windows are created (if "Notify Subscribers" is enabled)
- Alert Updates - When alerts are updated with new information
- Status Changes - When incident or maintenance status changes
- Alert Resolution - When incidents are resolved or maintenance is completed
Troubleshooting
Email Not Sending
Check Configuration:
docker compose exec app php artisan config:cache
docker compose exec app php artisan queue:restart
View Logs:
docker compose logs app | grep -i mail
Test SMTP Connection:
docker compose exec app php artisan tinker
>>> Mail::raw('Test email', function($msg) { $msg->to('[email protected]')->subject('Test'); });
Common Issues
Authentication Failed
- Verify
MAIL_USERNAME
andMAIL_PASSWORD
are correct - Some providers require app-specific passwords (Gmail, Outlook)
- Check if 2FA is enabled on your email account
Connection Timeout
- Verify
MAIL_HOST
andMAIL_PORT
are correct - Check firewall allows outbound connections on SMTP port
- Try alternative ports (25, 465, 587, 2525)
Emails Go to Spam
- Configure SPF, DKIM, and DMARC records for your domain
- Use a reputable SMTP provider
- Ensure
MAIL_FROM_ADDRESS
uses your domain - Avoid using generic domains for sender address
Queue Not Processing
- Restart queue workers:
docker compose restart app
- Check queue status:
docker compose exec app php artisan queue:work --once
- Clear failed jobs:
docker compose exec app php artisan queue:clear
Best Practices
Security
- Use TLS/SSL encryption (
MAIL_ENCRYPTION="tls"
or"ssl"
) - Use app-specific passwords instead of main account passwords
- Rotate SMTP credentials periodically
- Restrict SMTP access to your server's IP if possible
Deliverability
- Use a dedicated SMTP service (Mailgun, SendGrid, Amazon SES)
- Configure SPF, DKIM, and DMARC DNS records
- Use a professional
MAIL_FROM_ADDRESS
with your domain - Monitor bounce rates and unsubscribe requests
Performance
- Use a reliable SMTP provider with good uptime
- Monitor email queue length
- Set up queue workers to process emails asynchronously
- Consider rate limiting for high-volume notifications
Additional Resources
- Laravel Mail Documentation
- Advanced Configuration - Queue and cache management
- Users & Roles - Member profile management