-
Notifications
You must be signed in to change notification settings - Fork 83
Extending API
Currently Ecwid-mailchimp itself has wrappers for a limited number of MailChimp API methods only. However, it is very easy to extend the API and add support for any method you need:
-
Create a subclass of MailChimpMethod.
-
Mark the class with the MailChimpMethod.Method annotation. The annotation specifies the corresponding MailChimp API method name and the API version to be used to execute the method.
-
Add necessary fields to your class and mark them with the MailChimpObject.Field annotation.
To understand it better, have a look at an existing method implementation, for example lists/batch-subscribe.
Contributions are welcome!
Contributors are encouraged (not required though) to write integration tests proving that the API methods they implement work as expected.
In order to run the existing tests it should be enough to do the following:
-
Add the following properties to '~/.m2/settings.xml':
<properties> <mailchimp.test.apikey>*******</mailchimp.test.apikey> <mailchimp.test.listid>*******</mailchimp.test.listid> </properties>
-
Run the tests using the following command line:
mvn test