GithubHelp home page GithubHelp logo

actuallymentor / mailchimp-api-v3.0-php-curl-example Goto Github PK

View Code? Open in Web Editor NEW
52.0 12.0 35.0 10 KB

This is a Mailchimp API 3 example using PHP and cURL. I made this for a client, took a while because their documentation is horrible, though maybe they improved it by the time you read this.

PHP 100.00%

mailchimp-api-v3.0-php-curl-example's Introduction

MailChimp API v3.0 Example

This ia a Mailchimp API 3 example using PHP and cURL. I made this for a client, took a while because their documentation is horrible, though maybe they improved it by the time you read this.

My collegue wanted a file he could post data to, this file would then execute MailChimp API calls.

Usage

The php file takes POSTed arguments. There are 5 functions in this file:

  • Adding a subscriber 'mc_subscribe();'
  • Changing a subscriber fname merge tag 'mc_changename();'
  • Adding someone to an interest group 'mc_addinterest();'
  • Removing a subscriber from an interest group 'mc_reminterest();'
  • Checking if a subscriber exists (returns 'subscribed' or '404')

Check the file to see what arguments are needed for these separate functions.

Post tester

The post tester file can be used to test queries from your broswer. It's a form to post to the actor php.

Variables you need to set

At the top of the file you need to set:

  • Your API key from MailChimp
  • Your MailChimp server prefix (e.g. us1.)

Debug and testing

If you set the posted $_POST["debug"] to true the MailChimp API response if outputted into the screen.

License

Use this as you will. Tweet me as thanks at @ActuallyMentor.

mailchimp-api-v3.0-php-curl-example's People

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

Watchers

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

mailchimp-api-v3.0-php-curl-example's Issues

Bad url for API

Hello! Thanks for your apport!

While i was debugging the code. I get notice that there is missing a dot between the server and api in the CURLOPT_URL in every method you call.

I believe it must be.

https://'.$server.'.api.mailchimp.com/3.0/lists/'.$list_id.'/members/

Greetings!

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.