PHP code example of luyadev / luya-module-mailchimp

1. Go to this page and download the library: Download luyadev/luya-module-mailchimp 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/ */

    

luyadev / luya-module-mailchimp example snippets


'modules' => [
    //...
    'newsletter-form' => [
        'class' => 'luya\mailchimp\Module',
        'listId' => 'MailChimp-List-ID',
        'attributes' => [
            'email', 'firstname', 'lastname', 'street', 'zip_city', 'country'
        ],
        'rules' => [
            [['email', 'firstname', 'lastname', 'zip_city', 'country'], '[email protected]',
        ],
        'mailchimpApi' => 'MailChimp API Key',
    ],

<h2><?= Yii::$app->siteTitle;



use yii\widgets\ActiveForm;
use yii\helpers\Html;

 if (Yii::$app->session->getFlash('mailchimpSuccess')): 

<?= $form->field($model, 'mc_language')->hiddenInput(['value'=> Yii::$app->composition->langShortCode])->label(false)