PHP code example of yii2-mailwizz / mailwizz

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

    

yii2-mailwizz / mailwizz example snippets


$ php composer.phar 


namespace common\components\mailwizz;

use MailWizzApi\Base;
use MailWizzApi\Cache\File;
use MailWizzApi\Config;
use MailWizzApi\Endpoint\Lists;
use MailWizzApi\Endpoint\ListSubscribers;
use yii\base\Component;
use Yii;

/**
 * Class MailWizz
 * @package common\components\mailwizz\MailWizz
 */
class MailWizz extends Component
{


    public function __construct(){
        $config = new Config([
            'apiUrl'        => 'ApiUrl',
            'publicKey'     => 'Pub_key',
            'privateKey'    => 'Private_key',
            'components' => array(
                'cache' => array(
                    'class'     => File::class,
                    'filesPath' => dirname(__FILE__) . '/../MailWizzApi/Cache/data/cache', // make sure it is writable by webserver
                )
            ),
        ]);
        Base::setConfig($config);
    }
}