Git Product home page Git Product logo

hypemailchimpbundle's Introduction

Hype MailchimpBundle for API V2.0

Latest Version on Packagist

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

  1. campaigns/create
  2. campaigns/content
  3. campaigns/list
  4. campaigns/delete
  5. campaigns/pause
  6. campaigns/ready
  7. campaigns/replicate
  8. campaigns/ready
  9. campaigns/resume
  10. campaigns/send
  11. campaigns/send-test
  12. campaigns/segment-test
  13. campaigns/schedule
  14. campaigns/schedule-batch
  15. campaigns/unschedule
  16. campaigns/update

Lists related

  1. lists/list
  2. lists/abuse-reports
  3. lists/activity
  4. lists/subscribe
  5. lists/unsubscribe
  6. lists/member-info
  7. lists/interest-groupings
  8. lists/interest-grouping-add
  9. lists/interest-grouping-del
  10. lists/interest-grouping-update
  11. lists/interest-group-add
  12. lists/interest-group-update
  13. lists/interest-group-del
  14. lists/segments
  15. lists/segment-test

Templates related

  1. templates/add
  2. templates/list
  3. templates/del
  4. templates/info
  5. templates/undel

Export API

  1. list
  2. campaignSubscriberActivity

Helper related

  1. helper/ping
  2. helper/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' => '[email protected]',
            '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('[email protected]');
        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('[email protected]');
?>

hypemailchimpbundle's People

Contributors

ahmedsamy avatar gabriperego avatar izotopsvk avatar matthieumota avatar mbellotti avatar mhouchin avatar nyrodev avatar phobetor avatar voslartomas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hypemailchimpbundle's Issues

How to set an API key on the fly

I show that the this feature was added 8 months ago to set the setApikey(), but there is no documentation for it. I have many api keys (many customers) how do I activate that account and then add subscribers to a list in that account?

where do I put the setApikey()?
$mc = $this->get('hype_mailchimp');
$mc->setApikey('xxxxxxxx-us11');
$data = $mc->getList()
->setListId('xxxxxxxx')
->subscribe('[email protected]');
var_dump($data);

API configs as separate vars

I have seen another MailChimp bundle (only for API v1.3 at the moment) which uses separate variables for defining things like double_optin, send_welcome and things like that rather then like you do now setting those in the parameters of the different functions.

If you don't want this it is ok for me, I just think it is more clear for the user of this bundle and easier to use. But if you do like this, I could look into this this weekend of you want.

current version specify api key value

I installed and configured the bundle, then did I campaign create using the API and it showed up in mailchimp.com, but few hours later, I did it again and return code -100 specify apikey value.

API command 'listStaticSegmentMembersAdd'

I noticed there wasn't any reference to the method 'listStaticSegmentMembersAdd'. Being that people will be handling a lot of user management on their own servers, I feel this would be a crucial API method to add.

Thanks for building such a great github project!

Support MailChimp API v3.0?

MailChimp have just announced that their v3 API now has full feature parity, and also that previous versions of the API will cease to be operational at the end of 2016.

Has anyone started taking a look at what is involved in implementing v3?

SSL: CA certificate set, but certificate verification is disabled

I am getting the error

SSL: CA certificate set, but certificate verification is disabled

When I try to add the subscriber to the list

$mc = $this->get('hype_mailchimp');
        $data = $mc->getList()
            ->subscribe($email);

I am getting this error locally on my mac.

Any help will be appreciated.

$mailchimp->getList()->subscribe($email) problem !

Hello,

when i use $mailchimp->getList()->subscribe($email). The new subscriber is not added on my list.
i have the correct API key + ID list but when i go on my MC account there is no new subscriber..

Any idea ? I use Symfony 3

Thanks

how to add subscriber name?

Hi,

Thanks for sharing the bundle, i got it to work just fine, I can get the subscriber added using email however i cant seem to find a way to add subscriber first and last name?

Even your subscribe function does not seem to be taking any names

public function subscribe($email_id, $email_type = 'html', $double_optin = true, $update_existing = true, $replace_interests = true, $send_welcome = false, $email_identifier = 'email') {

Is this repo still maintained ?

Hello @AhmedSamy,

It looks like you don't maintain the repository anymore but there is a real usage.
I suggest you to recruit some people to help you to maintain the repo or I will consider to register my fork to be able to continue to use it (with Symfony3 and mailchimpv3 too.

Thank you

Subscriber doesnt subscribe

Hi! my code:
$mc = $this->get('hype_mailchimp');
$result=$mc->getList()
->setListId('49f0e2fed9')
->subscribe($freecalc->getEmail());
exit(var_dump($result));

when I try to add subscribers to the list, the method returns an array. A subscriber is not really added.

addMerge_vars is not working fine

->addMerge_vars(
array(
'lname' => 'pepe'
))
this function generate a json output link this

[{"lname":"pepe"}]

and if I use

->setMerge_vars(array(
'lname' => 'pepe'
))

generate this:

{"lname":"pepe"}

the first one doesn't work, the second yes.
and the first is in the example in the readme

regards

Is it possible to get api_key?

I am creating webhook for mailchimp and I would like to get somehow api_key from this bundle, because it's already defined in config. But it's not possible imho or is it?

Facing CURL timeout Issue

Hi there,

I have tried the bundle, but found that there is no way we can set the default settings or provide the curl settings anywhere in the config. while m facing the curl timeout issue, as in the RestClient.php file there are no curl_opt set for the timeouts, as default timeouts sets at 10 seconds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.