1. Go to this page and download the library: Download aelvan/mailchimp-subscribe 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/ */
aelvan / mailchimp-subscribe example snippets
use aelvan\mailchimpsubscribe\events\SubscribeEvent;
use aelvan\mailchimpsubscribe\services\MailchimpSubscribeService;
Event::on(
MailchimpSubscribeService::class,
MailchimpSubscribeService::EVENT_AFTER_SUBSCRIBE,
function (SubscribeEvent $event) {
// custom logic
}
);
use aelvan\mailchimpsubscribe\events\UnsubscribeEvent;
use aelvan\mailchimpsubscribe\services\MailchimpSubscribeService;
Event::on(
MailchimpSubscribeService::class,
MailchimpSubscribeService::EVENT_AFTER_UNSUBSCRIBE,
function (UnsubscribeEvent $event) {
// custom logic
}
);
use aelvan\mailchimpsubscribe\events\DeleteEvent;
use aelvan\mailchimpsubscribe\services\MailchimpSubscribeService;
Event::on(
MailchimpSubscribeService::class,
MailchimpSubscribeService::EVENT_AFTER_DELETE,
function (DeleteEvent $event) {
// custom logic
}
);