-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 679a1a5
Showing
10 changed files
with
2,687 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/vendor | ||
composer.phar | ||
composer.lock | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
|
||
before_script: | ||
- curl -s http://getcomposer.org/installer | php | ||
- php composer.phar install --dev | ||
|
||
script: phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Mailchimp API w. support for Laravel | ||
--- | ||
|
||
This package acts as an alternative mirror for the PHP class, for use with the MailChimp API, provided by MailChimp® [Here][1]. | ||
|
||
The package supports use with the [Laravel framework][2] (v4) providing a `Mailchimp` facade. | ||
|
||
---- | ||
|
||
###Setup: | ||
|
||
In order to install add the following to your `composer.json` file within the `require` block: | ||
|
||
"require": { | ||
… | ||
"hugofirth/mailchimp": "dev-master", | ||
… | ||
} | ||
|
||
Within Laravel, locate the file `..app/config/app.php` *. | ||
|
||
Add the following to the `providers` array: | ||
|
||
'providers' => array( | ||
… | ||
'Hugofirth\Mailchimp\MailchimpServiceProvider', | ||
… | ||
), | ||
|
||
Furthermore, add the following the the `aliases` array: | ||
|
||
'aliases' => array( | ||
… | ||
'Mailchimp' => 'Hugofirth\Mailchimp\Facades\Mailchimp', | ||
… | ||
), | ||
|
||
Lastly, run the command `composer update`. | ||
|
||
_\* The subsequent steps should be repeated for any file `app.php` created for additional environments._ | ||
|
||
---- | ||
|
||
###Usage: | ||
|
||
Your unique MailChimp API key should be set in the package's config found in `..vendor/hugofirth/mailchimp/src/config/config.php` | ||
|
||
Methods of the MailChimp api class work as described by the MailChimp API docs found [Here][3]. Thanks to Laravel's use of the "Facade" design pattern, all methods may be called in the following manner: | ||
|
||
… | ||
//Retrieve an array of lists for your account | ||
$lists = Mailchimp::lists(); | ||
… | ||
//Subscribe a user, with email: $email_address, to a list with id: $list_id | ||
Mailchimp::listSubscribe($list_id, $email_address); | ||
|
||
Enjoy! | ||
|
||
[1]: http://apidocs.mailchimp.com/api/downloads/#php | ||
[2]: http://laravel.com/ | ||
[3]: http://apidocs.mailchimp.com/api/1.3/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "hugofirth/mailchimp", | ||
"description": "Wrapper on the MCAPI class provided by Mailchimp - with support for Laravel 4", | ||
"keywords": ["laravel", "mailchimp"], | ||
"authors": [ | ||
{ | ||
"name": "Hugo Firth", | ||
"email": "hebfirth@gmail.com" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.3.0", | ||
"illuminate/support": "4.0.x" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"Hugofirth\\Mailchimp": "src/" | ||
} | ||
}, | ||
"minimum-stability": "dev" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Package Test Suite"> | ||
<directory suffix=".php">./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace HugoFirth\Mailchimp\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class Mailchimp extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'mailchimp'; | ||
} | ||
} |
Oops, something went wrong.