https://github.com/intracto/campaignmonitorbundle
A Symfony wrapper for the Campaign Monitor PHP library
https://github.com/intracto/campaignmonitorbundle
Last synced: 8 months ago
JSON representation
A Symfony wrapper for the Campaign Monitor PHP library
- Host: GitHub
- URL: https://github.com/intracto/campaignmonitorbundle
- Owner: Intracto
- License: mit
- Created: 2016-07-20T12:18:46.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T10:39:57.000Z (over 8 years ago)
- Last Synced: 2025-04-15T10:25:24.362Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 4
- Watchers: 31
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IntractoCampaignMonitorBundle
Welcome to the IntractoCampaignMonitorBundle - a Symfony wrapper for the Campaign Monitor PHP library.
For details on how to get started with IntractoCampaignMonitorBundle, keep on reading.
## What's inside?
The IntractoCampaignMonitorBundle has following features:
- All results from the API are hydrated to different models.
- Paged results are returned as a Paginator instance with a method to get the next set of records.
- A defensive programming approach in all classes to prevent broken instances.
All code included in the IntractoCampaignMonitorBundle is released under the MIT or BSD license.
## Installation
### Step 1 - Install IntractoCampaignMonitorBundle using composer
Edit your composer.json to include the bundle as a dependency.
```js
{
"require": {
"intracto/campaign-monitor-bundle": "0.1",
}
}
```
Open up a command line window and tell composer to download the new dependency.
``` bash
$ php composer.phar update intracto/campaign-monitor-bundle
```
### Step 2 - Register the bundle in your AppKernel file
``` php
get('itr.campaign_monitor.factory.client_connector');
$clientId = $this->getParameter('your_client_id');
$clientConnector = $clientConnectorFactory->getConnectorForId($clientId);
/** @var ListReference[]|ArrayCollection $lists */
$lists = $clientConnector->getLists();
return $this->render('your_template_file.html.twig', ['lists' => $lists]);
}
...
}
```
Have a look inside the Connector classes to check out what methods are available. Nearly all methods will return a response in OOP-style.
Paginated results like subscribers lists, will be put into a Paginator instance. This class has a next() method, that will execute another request to the Campaign Monitor API for the next page.
Not all methods of the CampaignMonitor API are available yet. If some are missing, feel free to open up an issue.
Pull requests are also greatly appreciated!