You are currently reading the documentation for v5, while the latest version is v7.

Configuration recommendations

On this page:

Mailcoach will send each mail in a separate job that has its own database connection. We highly recommend make sure that your database can handle at least as many database connections possible connections as the allowed number of jobs that can happen in a second.

So, if you have this configuration in mailcoach.php

'allowed_number_of_jobs_in_timespan' => 30,
'timespan_in_seconds' => 1,

… your database should be able to handle at least 30 connection.

You can find out your connection limit by executing this query

SHOW VARIABLES LIKE "max_connections"

Uploads on Vapor

Due to the serverless nature of Vapor, file uploads should be stored in a cloud storage system, such as AWS S3 or Google Cloud Storage. You can read more about configuring cloud storage for Vapor here.

For Mailcoach, this applies to subscriber imports and image uploads in the mail editors.

Image uploads in editors

Make sure you have an S3 disk configuration that contains 'visibility' => 'public'. For example:

// config/filesystems.php

'media' => [
    'driver' => 's3',
    'key' => env('AWS_ACCESS_KEY_ID'),
    'secret' => env('AWS_SECRET_ACCESS_KEY'),
    'region' => env('AWS_DEFAULT_REGION'),
    'bucket' => env('AWS_BUCKET'),
    'url' => env('AWS_URL'),
    'endpoint' => env('AWS_ENDPOINT'),
    'visibility' => 'public', // <-- This line is very important for image uploads to work
],

Then, make sure to set the disk_name configuration value to the name of your disk for Unlayer and/or the Editor.js editor, in this case media

// config/mailcoach.php

'unlayer' => [
    'disk_name' => 'media'
],

'mailcoach-editor' => [
    'disk_name' => 'media'
],

Subscriber imports

Make sure you have a private S3 disk configuration in your filesystems.php config file. For example:

// config/filesystems.php

'subscriber_imports' => [
    'driver' => 's3',
    'key' => env('AWS_ACCESS_KEY_ID'),
    'secret' => env('AWS_SECRET_ACCESS_KEY'),
    'region' => env('AWS_DEFAULT_REGION'),
    'bucket' => env('AWS_BUCKET'),
    'url' => env('AWS_URL'),
    'endpoint' => env('AWS_ENDPOINT'),
    'visibility' => 'private',
],

Finally, set the mailcoach.audience.import_subscribers_disk configuration to use the same private filesystem as well:

// config/mailcoach.php

'audience' => [
    ...

    /*
     * This disk will be used to store files regarding importing subscribers.
     */
    'import_subscribers_disk' => 'subscriber_imports',
],
Introduction