Laravel Mail Complete Guide

Complete reference documentation for setting up and configuring email marketing campaigns in the Laravel Mail platform.

Important: For security reasons, we recommend setting up Laravel Marketing Platform as soon as possible after installation.

Laravel Marketing Platform comes packaged with a command-line setup utility that will get you up and running in a few minutes. It will attempt to automatically configure Laravel Marketing Platform and create a default user account and workspace for administrative purposes.

Setup Command

Recommended - Automated setup process

Setup Wizard

Web-based guided installation

Manual Configuration

Complete manual setup control

Setup Command (Recommended)

In the Laravel Marketing Platform installation's root directory, run the following command:

php artisan sp:install

The command will prompt you for confirmation on most steps. If this is the first time running setup for an installation, you should answer yes to the prompts in order to ensure that Laravel Marketing Platform is completely set up as expected.

You can safely run the command multiple times if needed.

Setup Wizard

You can also use a Setup Wizard to guide you through the installation process. If you are hosting Laravel Marketing Platform at campaigns.laravelmail.com, just point your browser to campaigns.laravelmail.com/setup to launch the setup process.

Note: In order to launch the Setup Wizard the .env file must already be present in the root folder of your installation, and the encryption key must be set.

Once your first user has been created, the Setup Wizard will no longer be available.

Additional Configuration

Cron Jobs

Laravel Marketing Platform makes use of regular background tasks and it is therefore essential to create a cron job to run every minute:

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

Please refer to the Laravel documentation on Task Scheduling for further information.

Message Sending & Queues

Laravel Marketing Platform sends email messages using a queue system. The queue can be processed synchronously or asynchronously. Set the QUEUE_CONNECTION parameter in your .env file.

Sync

Simple synchronous processing

✓ Simple setup
✗ Not scalable
QUEUE_CONNECTION=sync

Database

Medium-sized mailing lists

✓ No extra services
⚠ May affect DB performance
QUEUE_CONNECTION=database
php artisan queue:table
php artisan migrate

Redis

Recommended for large lists

✓ Best performance
⚠ Requires Redis server
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1
REDIS_PORT=6379

Laravel Horizon (Redis)

Laravel Marketing Platform bundles Laravel Horizon as an easy way to run and manage redis queues with autoscaling capabilities.

php artisan horizon:publish
php artisan horizon

User Management Email

In order to use user management functionality (inviting new users, password resets), set up an email service for Laravel Marketing Platform's internal use.

Set Laravel Marketing Platform_REGISTER=true to enable registration and user invitation functionality. Set Laravel Marketing Platform_PASSWORD_RESET=false to disable password resets if desired.

SMTP/Sendmail

MAIL_MAILER=smtp
MAIL_HOST
MAIL_PORT
MAIL_USERNAME
MAIL_PASSWORD

Amazon SES

MAIL_MAILER=ses
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION

Mailgun/Postmark

MAILGUN_DOMAIN
MAILGUN_SECRET
or
POSTMARK_TOKEN

Ready to Get Started?

Follow the setup command for the quickest installation, then configure your first email service and create your first campaign.

php artisan sp:install