Skip to content

Production setup for email verification feature #3

Description

@SteadfastKnight

Overview

Email verification (PR #2) requires production configuration for full functionality.

Required Setup

1. Cron Job for Laravel Scheduler

Add to server crontab:

* * * * * cd /path-to-project && php artisan schedule:run >> /dev/null 2>&1

This runs the daily cleanup of unverified accounts older than 5 days.

2. SMTP Configuration

Update .env with real mail provider:

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME=WordKeep

Options: Mailgun, SendGrid, AWS SES, Postmark, etc.

3. Queue Worker

Verification emails are queued. Ensure queue worker is running:

php artisan queue:work --daemon

Or use Supervisor/systemd to keep it running.

Alternative: set QUEUE_CONNECTION=sync to send emails immediately (not recommended for production).

4. Frontend URL

Set correct production frontend URL in .env:

FRONTEND_URL=https://app.yourdomain.com

This is used for verification email links.

Optional

Rate Limiting

Consider adding rate limiting to resend-verification endpoint (currently unlimited).

Monitoring

  • Monitor failed_jobs table for failed email sends
  • Set up alerts for queue backlog

Checklist

  • Cron job configured
  • SMTP credentials set
  • Queue worker running
  • FRONTEND_URL set to production URL
  • Test email delivery in production

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions