0

Mailchimp Api Integration In PHP

MailChimp API Integration In PHP

Mailchimp Api Integration In PHP

MailChimp is the one of the most popular email api which is used to send newslatter email. Its a third party api so we just need to do some custom code.
In Following tutorial i am sharing code to subscriber user email to mailchimp.

Step 1 Create a Mailchimp Account

Create MailChimp Account. After creating the account now we need to create API Keys and List ID

Go to your Account Settings -> Extras -> API Keys
Click on Create a Key button and you will have you API key ready.
After that go to Lists section, Create List, Visit your created lists under Settings -> List name & defaults you will find List ID.

Step 2

Now download the mailchimp php library.

PHP CODE

MailChimp API send request through CURL so make sure you have enabled CURL in your PHP.

Create a php file subscribe.php

Place this inside subscribe.php file.

Step 3 Create Html File

Create a index.html, place following code

Step 4 JAVASCRIPT

So here you go all done with basic code setup, make changes as you need with code.

Note:

MailChimp does not show subscribers in your created list unless user activated their email. When user subscribes MailChimp send activation URL so only valid emails can subscribe.MailChimp API Integration In PHP

Sandeep Kumar

Sandeep kumar is a web developer and a professinal blogger. He works for latest technologies and write articles what he learn. In ICodeHub he share web languages tutorials and other programming tips and tricks. if you need some help or have some suggestion then mail him at sandeep92pal@gmail.com without any hesitation. He believes in learning and sharing.