https://github.com/casinelli/laravel-campaignmonitor
A Laravel 5 wrapper for CampaignMonitor APIs
https://github.com/casinelli/laravel-campaignmonitor
campaign-monitor laravel
Last synced: 4 months ago
JSON representation
A Laravel 5 wrapper for CampaignMonitor APIs
- Host: GitHub
- URL: https://github.com/casinelli/laravel-campaignmonitor
- Owner: Casinelli
- License: mit
- Created: 2015-10-12T18:40:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-29T15:47:21.000Z (over 8 years ago)
- Last Synced: 2024-09-24T09:22:29.780Z (8 months ago)
- Topics: campaign-monitor, laravel
- Language: PHP
- Size: 12.7 KB
- Stars: 12
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel-CampaignMonitor
A Laravel 5 wrapper for CampaignMonitor APIs## Installation
- [Laravel-CampaignMonitor on Packagist](https://packagist.org/packages/casinelli/laravel-campaignmonitor)
- [Laravel-CampaignMonitor on GitHub](https://github.com/Casinelli/Laravel-CampaignMonitor)To get the latest version of Laravel-CampaignMonitor simply require it in your `composer.json` file.
~~~
"casinelli/laravel-campaignmonitor": "dev-master"
~~~You'll then need to run `composer install` to download it and have the autoloader updated.
Once Laravel-CampaignMonitor is installed you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.
~~~php
[Casinelli\CampaignMonitor\CampaignMonitorServiceProvider::class,
]
~~~Laravel-CampaignMonitor also ships with a facade. You can register the facade in the `aliases` key of your `app/config/app.php` file.
~~~php
['CampaignMonitor' => Casinelli\CampaignMonitor\Facades\CampaignMonitor::class,
]
~~~Create the configuration file using artisan
~~~
$ php artisan vendor:publish --provider="Casinelli\CampaignMonitor\CampaignMonitorServiceProvider"
~~~And set your own API key and Client ID:
~~~php
env('CAMPAIGNMONITOR_API_KEY'),'client_id' => env('CAMPAIGNMONITOR_CLIENT_ID'),
];
~~~## Usage
You can find all the methods in the original [campaignmonitor/createsend-php package](https://github.com/campaignmonitor/createsend-php).
Some examples:
~~~php
add([
'EmailAddress' => '[email protected]',
'Name' => 'Giovanni Casinelli',
]);// Create a list for a Client:
$result = CampaignMonitor::lists()->create(\Config::get('campaignmonitor.client_id'), [
'Title' => 'List name',
]);
~~~To send classic transactional emails:
~~~php
'[email protected]',
'To' => '[email protected]',
'ReplyTo' => '[email protected]',
'CC' => '[email protected]',
'BCC' => '[email protected]',
'HTML' => 'Hello there!
',
'Text' => 'Hello there!',
];CampaignMonitor::classicSend('CLIENT_ID')->send($data);
~~~