Skip to content

Latest commit

 

History

History
129 lines (104 loc) · 2.81 KB

File metadata and controls

129 lines (104 loc) · 2.81 KB

UPGRADE FROM 2.x to 3.0

Version 3.0 introduces breaking changes for Laravel and Symfony frameworks. This guide helps you upgrade your application accordingly.

Laravel Integration

  1. Change mailtrap transport inside your config/mail.php file.

Before:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Mailer Configurations
    |--------------------------------------------------------------------------
    */
    'mailers' => [
    
            // start mailtrap transport
            'mailtrap' => [
                'transport' => 'mailtrap'
            ],
            // end mailtrap transport
    
    ]
];

After:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Mailer Configurations
    |--------------------------------------------------------------------------
    */
    'mailers' => [
    
            // start mailtrap transport
            'mailtrap-sdk' => [
                'transport' => 'mailtrap-sdk'
            ],
            // end mailtrap transport
    
    ]
];
  1. Set mailtrap-sdk transport as a default instead mailtrap inside your .env file.
MAIL_MAILER="mailtrap-sdk"
  1. Rename mailtrap config file and variables

Before:

# /config/mailtrap.php

<?php

return [
    'mailtrap' => [
        'host' => env('MAILTRAP_HOST', 'send.api.mailtrap.io'),
        'apiKey' => env('MAILTRAP_API_KEY'),
        'inboxId' => env('MAILTRAP_INBOX_ID'),
    ],
];

After:

# /config/mailtrap-sdk.php

<?php

return [
    'mailtrap-sdk' => [
        'host' => env('MAILTRAP_HOST', 'send.api.mailtrap.io'),
        'apiKey' => env('MAILTRAP_API_KEY'),
        'inboxId' => env('MAILTRAP_INBOX_ID'),
    ],
];

Symfony Integration

  1. Change configuration inside your config/services.yaml file

Before:

...
    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones

    Mailtrap\Bridge\Transport\MailtrapTransportFactory:
        tags:
            - { name: 'mailer.transport_factory' }

After:

...
    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones

    Mailtrap\Bridge\Transport\MailtrapSdkTransportFactory:
        tags:
            - { name: 'mailer.transport_factory' }
  1. Change MAILER_DSN variable inside your .env

Before:

MAILER_DSN=mailtrap://YOUR_API_KEY_HERE@default
# or
MAILER_DSN=mailtrap+api://YOUR_API_KEY_HERE@send.api.mailtrap.io

After:

MAILER_DSN=mailtrap+sdk://YOUR_API_KEY_HERE@default
# or
MAILER_DSN=mailtrap+sdk://YOUR_API_KEY_HERE@send.api.mailtrap.io