This repository was archived by the owner on Jan 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +40
-6
lines changed
Expand file tree Collapse file tree 4 files changed +40
-6
lines changed Original file line number Diff line number Diff line change 1- # Created by .ignore support plugin (hsz.mobi)
1+ vendor
2+ composer.lock
Original file line number Diff line number Diff line change 1- # mailchimp-api
1+ # Devlib/MailChimp-API
2+
23Simple MailChimp API Wrapper
4+
5+ ### Install
6+ ` composer require devlib/mailchimp-api `
7+
8+ ### Usage
9+ ``` php
10+ use DevLib\API\MailChimp\MailChimp;
11+
12+ $apiKey = getenv('MC_API_KEY');
13+ $list_id = getenv('MC_LIST_ID');
14+
15+ $api = new MailChimp($apiKey, $list_id);
16+ ```
17+
18+ ### Subscribe user
19+ ``` php
20+ use DevLib\API\MailChimp\MailChimp;
21+ use MailChimpAPIException
22+
23+ $email = 'you@example.com';
24+
25+ try{
26+
27+ $api->subscribe($email, [
28+ 'FNAME' => 'Emma',
29+ 'LNAME' => 'Doe'
30+ ]);
31+
32+ }catch(MailChimp\MailChimpAPIException $e){
33+ echo ( 'Error: ' . $e->getMessage() );
34+ }
35+ ```
Original file line number Diff line number Diff line change 11<?php
22/**
3- * SMS Signin Gateway - Mailchimp API integration class
4- * @author adrian7 (adrian@studentmoneysaver.co.uk)
5- * @version 1.1
3+ * MailChimp API Wrapper Main Class
4+ * @author adrian7
5+ * @version 1.0
66 */
77
88namespace DevLib \API \MailChimp ;
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ protected function _before() {
6161 $ this ->fail ("Please provide the MAILCHIMP_LIST_ID env variable ... . " );
6262
6363 //init wrapper
64- $ this ->wrapper = new \ DevLib \API \MailChimp ( $ apiKey , $ this ->list_id );
64+ $ this ->wrapper = new DevLib \API \ MailChimp \MailChimp ( $ apiKey , $ this ->list_id );
6565
6666 }
6767
You can’t perform that action at this time.
0 commit comments