PHP code example of albertborsos / yii2-mailmaster

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

    

albertborsos / yii2-mailmaster example snippets


  'components' => [
    ...
    'mailmaster' => [
          'class' => 'albertborsos\mailmaster\MailMaster',
          'apiUser' => 'mailmaster-api-user-name',
          'apiKey' => 'mailmaster-api-password',
          'forms' => [
              'your-form-id' =>[
                  'formID' => 'mailmaster-form-id',
                  'listID' => 'mailmaster-list-id',
              ],
          ],
    ],
    ...
  ],
...

  /** @var \albertborsos\mailmaster\MailMaster $mmc */
  $mmc = Yii::$app->mailmaster;
  $mm = $mmc->factory($this->_listID, $this->_formID);

  $response = $mm->subscribe([
      'email' => $this->email,
      'mssys_firstname' => $this->nameFirst,
      'mssys_lastname' => $this->nameLast,
  ]);