panix / mod-mailchimp
Mailchimp to manage Mailchimp Email Platform in a Yii2 site.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- drewm/mailchimp-api: ^2.5
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-29 06:30:54 UTC
README
MailChimp extension to manage the Mailchimp Email Marketing Platform:
- Website: https://www.mailchimp.com/
- PHP API: https://github.com/drewm/mailchimp-api
- Documentation: https://mailchimp.com/developer/reference/
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require panix/mod-mailchimp "*"
or add
"panix/mod-mailchimp": "*"
Configuration
Set on your configuration file
'modules' => [
'mailchimp' => [
'class' => 'panix\mod\mailchimp\Module',
'showFirstname' => true,
'showLastname' => true
]
]
Overrides
Override controller example, on modules config
'modules' => [
'mailchimp' => [
'class' => 'panix\mod\mailchimp\Module',
'controllerMap' => [
'default' => 'app\controllers\DefaultController',
]
]
],
Override view example, on components config
'components' => [
'view' => [
'theme' => [
'pathMap' => [
'@mailchimp/views/default' => '@app/views/mailchimp/default',
],
],
],
],
Usage
\Yii::$app->mailchimp;
\Yii::$app->mailchimp->getClient();
\Yii::$app->mailchimp->getLists();
\Yii::$app->mailchimp->getListMembers($id);
Widget Subscription Example
<?= Subscription::widget([
'list_id' => 'MYLISTID' // if not set raise Error
]) ?>
alternative to list_id you can set an list_array to set a list_id to a specific language
<?= Subscription::widget([
'list_array' => [
'en' => 'MYLISTID_EN',
'es' => 'MYLISTID_ES',
'it' => 'MYLISTID_IT',
]
]) ?>
Actions
- Lists View: PathToApp/index.php?r=mailchimp/default/lists
- Lists View with Pretty Urls: PathToApp/mailchimp/default/lists
- List View: PathToApp/index.php?r=mailchimp/default/list?id=XXX&name=XXX
- List View with Pretty Urls: PathToApp/mailchimp/default/list?id=XXX&name=XXX