ahmedsamy / hype-mailchimp-bundle
Mailchimp V2.0 API Object Oriented wrapper
Installs: 433 754
Dependents: 2
Suggesters: 0
Security: 0
Stars: 53
Watchers: 5
Forks: 21
Open Issues: 11
Type:symfony-bundle
pkg:composer/ahmedsamy/hype-mailchimp-bundle
Requires
- php: >=5.3.2
- ext-curl: *
- kriswallsmith/buzz: >=0.7
- symfony/framework-bundle: ~2.0|~3.0|~4.0
This package is not auto-updated.
Last update: 2025-10-21 22:49:49 UTC
README
Symfony2.x bundle for MailChimp API V2 and Export API API V1 Wrapper bundle that makes accessing Mailchimp functions easily in object oriented using method chaining
License
HypeMailChimp bundle released under MIT LICENSE
#Supported API Methods
Campaigns related
campaigns/createcampaigns/contentcampaigns/listcampaigns/deletecampaigns/pausecampaigns/readycampaigns/replicatecampaigns/readycampaigns/resumecampaigns/sendcampaigns/send-testcampaigns/segment-testcampaigns/schedulecampaigns/schedule-batchcampaigns/unschedulecampaigns/update
Lists related
lists/listlists/abuse-reportslists/activitylists/subscribelists/unsubscribelists/member-infolists/interest-groupingslists/interest-grouping-addlists/interest-grouping-dellists/interest-grouping-updatelists/interest-group-addlists/interest-group-updatelists/interest-group-dellists/segmentslists/segment-test
Templates related
templates/addtemplates/listtemplates/deltemplates/infotemplates/undel
Export API
listcampaignSubscriberActivity
Helper related
helper/pinghelper/generate-text
Need support for a method not on the list submit an issue
Setup
Step 1: Download HypeMailchimp using composer
Add HypeMailchimp in your composer.json:
{ "require": { "ahmedsamy/hype-mailchimp-bundle": "dev-master" } }
Now tell composer to download the bundle by running the command:
$ php composer.phar update "ahmedsamy/hype-mailchimp-bundle"
Composer will install the bundle to your project's vendor/ahmedsamy/hype directory.
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Hype\MailchimpBundle\HypeMailchimpBundle(), ); }
Step 3: Add configuration
# app/config/config.yml hype_mailchimp: api_key: xxxxxxx-us5 default_list: xxxxxxxx ssl: true #optional configuring curl connection
Usage
Using service
<?php $mailchimp = $this->get('hype_mailchimp'); ?>
##Examples
###Create new campaign
<?php $mc = $this->get('hype_mailchimp'); $data = $mc->getCampaign()->create('regular', array( 'list_id' => '93419bbdc0', 'subject' => 'test created subject', 'from_email' => 'ahmed.samy.cs@gmail.com', 'from_name' => 'Ahmed Samy', 'to_name' => 'fans' ), array( 'html' => '<h5>Html content</h5>', 'sections' => array(), 'text' => 'test', 'url' => 'http://www.example.com', 'archive' => 'test' )); var_dump($data); ?>
###Delete existing campaign
<?php $mc = $this->get('hype_mailchimp'); $data = $mc->getCampaign() ->setCi('1088b4ed65') ->del(); var_dump($data); ?>
###Send campaign
<?php $mc = $this->get('hype_mailchimp'); $data = $mc->getCampaign() ->setCi('1088b4ed65') ->send(); var_dump($data); ?>
###Subscribe new user to list
<?php $mc = $this->get('hype_mailchimp'); $data = $mc->getList() ->subscribe('moneky@suitMonkry.com'); var_dump($data); ?>
Note that the user will be subscribed to the default list set in config.yml.
If you want to change the list for this time only, you can use
<?php $mc = $this->get('hype_mailchimp'); $data = $mc->getList() ->setListId('xxxxxxx') ->addMerge_vars( array( 'mc_notes' => 'test notes' )) ->subscribe('moneky@suitMonkry.com'); ?>