PHP code example of lopezlean / cakephp-gourmet-email

1. Go to this page and download the library: Download lopezlean/cakephp-gourmet-email 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/ */

    

lopezlean / cakephp-gourmet-email example snippets


$this->addPlugin('Gourmet/Email');

// app/Template/Email/html/welcome.ctp
Welcome <?= $user['username'] 

        $mailer
            ->setEmailFormat('both')
            ->setTo("[email protected]")
            ->setFrom(['[email protected]' => 'Example'])
            ->viewBuilder()
                ->setHelpers(['Html','Gourmet/Email.Email'])
                ->setLayout('Gourmet/Email.default')
                ->setTemplate('my_template');