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

ParameterDescriptionExample
MAIL_MAILERMail driver to usesmtp, sendmail, mailgun, ses
MAIL_HOSTSMTP server hostnamemail.example.com
MAIL_PORTSMTP server port25, 465, 587, 2525
MAIL_USERNAMESMTP authentication username[email protected]
MAIL_PASSWORDSMTP authentication passwordYour SMTP password
MAIL_FROM_ADDRESSSender email address[email protected]
MAIL_FROM_NAMESender nameLIVCK 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

  1. Navigate to /user/profile
  2. Enter your Email address
  3. Click Save
  4. Click Test all configured Notification-Channels to verify email delivery

Testing Email Notifications

After configuring email settings:

  1. Log in as a member
  2. Go to /user/profile
  3. Ensure your email address is set
  4. Click the Test all configured Notification-Channels button
  5. 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 and MAIL_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 and MAIL_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