madalinignisca / sendgrid
Sendgrid plugin for CakePHP
Installs: 489
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 3
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=5.4.16
- cakephp/cakephp: ~3.0
- sendgrid/sendgrid: ~4.0
Requires (Dev)
This package is auto-updated.
Last update: 2025-01-07 15:06:27 UTC
README
details on installation tbd
Installation
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require madalinignisca/sendgrid
Configuration
Method 1 (modern, using ENV)
Add to config/bootstrap.php above
Email::configTransport(Configure::consume('EmailTransport'));
the following line
Plugin::load('MadalinIgnisca/Sendgrid', ['bootstrap' => true]);
The plugin loads from dotenv the following:
SENDGRID_USERNAME
SENDGRID_PASSWORD
or
SENGRID_API
Method 2 (classic, hardcoded credentials)
Add in your app.php file, in the EmailTransport item
'EmailTransport' => [
...
'sendgrid' => [
'className' => '\MadalinIgnisca\Sendgrid\Mailer\Transport\SendgridTransport',
'username' => 'your_username_or_api_key',
'password' => 'your_password_or_null_if_api_key,
]
...
],
Make sure if using V4 of Sendgrid, you set the API key as username (will alter code to also support config as 'apikey') for now.
To use it by default, set your default transport to sendgrid
in the Email config.