20/07
2013
Wallogit.com
2017 © Pedro Peláez
Madmimi is email, (*1)
In the require key of composer.json file add the following, (*2)
"buchin/madmimi": "dev-master"
Run the Composer update comand, (*3)
$ composer update
In your config/app.php add 'Buchin\Madmimi\MadmimiServiceProvider' to the end of the $providers array, (*4)
'providers' => array(
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Buchin\Madmimi\MadmimiServiceProvider',
),
At the end of config/app.php add 'Confide' => 'Zizaco\Confide\ConfideFacade' to the $aliases array, (*5)
'aliases' => array(
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
...
'Madmimi' => 'Buchin\Madmimi\Madmimi',
),
Lets say you want to add confirmed user to list., (*6)
// routes.php or controller
Route::get('user/confirm/{code}', function($code){
$user = User::where('confirmation_code', '=', $code)->firstOrFail();
Event::fire('user.confirm', $user);
//Confirm user here
});
// listener.php
Event::subscribe('user.confirm', function($user){
mimi = new Madmimi('email@example.com', 'api_key');
$user = array('email' => $user->email, 'firstName' => $user->firstname, 'add_list' => 'Test List');
$status = $mimi->addUser($user);
});