PHP code example of czepter / cake-mailjet

1. Go to this page and download the library: Download czepter/cake-mailjet 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/ */

    

czepter / cake-mailjet example snippets


'EmailTransport' => [
	'default' => [
		...
	],
	'mailjet' => [
		'className' => 'Mailjet.Mailjet',
		'apiKey' => 'your-api-key',
		'apiSecret' => 'your-api-secret'
	]
],

'Email' => [
	'default' => [
		'transport' => 'mailjet',

		'from' => '[email protected]',
		'charset' => 'utf-8',
		'headerCharset' => 'utf-8',
		],
	]
];

$email
   ->emailFormat('html')
   ->subject('some text')
   ->to('[email protected]')
   ->from('[email protected]')
   ->addHeaders([
	   'TemplateID' => 123456,
   ])
   ->setViewVars([
	   "greetings" => "a text wich replaces the var:greetings in your template",
	   ...
   ])
   ->send();
 php
$this->addPlugin('Mailjet');