I want to use the MailChimp API class in my Drupal module and I don’t know how can I include it in my module. I’ve added the class in sites/all/libraries and I cannot include it via drupal_get_path(). What’s the Drupal way to include an external library?
I want to use the MailChimp API class in my Drupal module and I
Share
Why don’t you simply use MailChimp module for Drupal?!
UPDATED
If it’s not for you, then try to implement the same method as in MailChimp module.
1) Add MailChimp class in your module folder, let’s say it’s
MailChimp.class.php.2) In your module add the following:
As you noticed class name should be same as class file name (
.class.phpshould be added because Drupal will find class file automatically).