PHP code example of gringlas / cakephp-mailjet-transport

1. Go to this page and download the library: Download gringlas/cakephp-mailjet-transport library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gringlas / cakephp-mailjet-transport example snippets


'EmailTransport' => [
        'default' => [
            'className' => 'gringlas\MailJetTransport\Mailer\MailJetTransport',
        ]
    ],

/**
* logging mailJet messages
*/
'mailJet' => [
    'className' => 'Cake\Log\Engine\FileLog',
    'path' => LOGS,
    'file' => 'mailJet',
    'url' => env('LOG_JETQUERIES_URL', null),
    'scopes' => ['mailJet']
],

public function passwordreset() {
    return $this
        ->setProfile([
            'TemplateID' => 1234
        ])
        ->setViewVars([
            'newPassword' => 'a192ja',
            'MailJet' => [
                'newPassword' => 'a192ja'
            ]
        ])
        ->setSubject('Password reset');
}