queencitycodefactory / cakemailslurp
CakePHP 3 MailSlurp Plugin
Installs: 108
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=7.2.0
- cakephp/cakephp: ^3.5.10
- mailslurp/mailslurp-client-php: ^15.14
Requires (Dev)
- cakephp/cakephp-codesniffer: ^3.0
- phpunit/phpunit: ^5.7 | ^6.0
This package is auto-updated.
Last update: 2024-11-29 02:26:43 UTC
README
CakePHP Plugin for MailSlurp
Requirements
- CakePHP 3.x
- PHP 7.2
Installation
[Using Composer]
composer require queencitycodefactory/cakemailslurp
Enable plugin
Load the plugin in your app's config/bootstrap.php
file:
Plugin::load('CakeMailSlurp', ['bootstrap' => false, 'routes' => false]);
OR load in src/Application.php
for CakePHP 3.6+
$this->addPlugin('CakeMailSlurp', ['bootstrap' => true, 'routes' => false]);
Usage For Replacing Mail or Smtp Transport
In config/app.php
or config/app_local.php
setup the EmailTransport config array:
'EmailTransport' => [ 'default' => [ 'className' => MailSlurpTransport::class, /* * The following keys are used in MailSlurp transports: */ 'inboxId' => 'your-inbox-id-goes-here', // The Inbox Id from MailSlurp 'apiKey' => 'your-api-key-goes-here', // The API Key from MailSlurp 'email' => 'your-email-goes-here', // The Email Address for the above Inbox Id 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null), ], 'debug' => [ 'className' => 'Debug', ], ],
Your existing code should still work if switching from MailTransport or SmtpTransport. This was built for transactional system emails.