Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
MailChimp Service for Drupal 8
The Drupal 8 module for MailChimp Service.
Installation
To install from this repository:
Clone the repository into your Drupal site modules directory:
git clone --branch 8.x-1.x https://git.drupal.org/project/mailchimp_service.git
cd mailchimp_service
This module require drewm/mailchimp-api": "^2.2
Install mailchimp-api by adding drewm/mailchimp-api": "^2.2"
in composer.json and composer install
Install the module, as usual, using Drush or the Drupal UI.
Configuration
Get Mailchimp API Key from http://admin.mailchimp.com/account/api
Configure Mailchimp API Key in admin/config/mailchimp_service/mailchimpserviceadmin
How to use API:
Example :
// Include service file in your file.
use Drupal\mailchimp_service\MailchimpService;
// Create profile array for mailChimp.
$userProfile = [
'FNAME' => 'FirstName of the user',
'LNAME' => 'FirstName of the user,
];
// Set type of sybscrption.
$type = 'subscribed'; // Type can be 'Status','pending','Update','unsubscribed', or 'subscribed'
// Subscription Email.
$email = 'youremail@example.com';
// MailChimp list id.
$mail_chimp_list_id ='xxxx'; // Add MailChimp list id.
$result = $this->mailchimpService->mailchimpSubscription($userProfile, $type, $email, $mail_chimp_list_id);
Project information
- Module categories: Developer Tools
- Created by rabithk on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.