buy domain website and hosting


Mailchimp Upcoming PHP Integration API security change in HTTPS

PHP

Mailchimp Upcoming API security change in HTTPS to communcate with mailchimp account.

below is the code about update the API key into config file.

//API Key - see http://admin.mailchimp.com/account/api
$apikey = 'f4f4f4f4d3d3d3d3d3ds2s2s2s2s-us7';

// A List Id to run examples against. use lists() to view all
// Also, login to MC account, go to List, then List Tools, and look for the List ID entry

$listId = 'f33ddfgftrfg';

// A Campaign Id to run examples against. use campaigns() to view all
// $campaignId = 'mailchimp1f6bf8709be9f4aa1f6f5749a.947e88ab6a';
$campaignId = 'r3332sssssb6a';

//some email addresses used in the examples:
//$my_email = 'sample@expertwebworld.com';
//$boss_man_email = 'support@expertwebworld.com';

//just used in xml-rpc examples
$apiUrl = 'http://api.mailchimp.com/1.3/';



Due to HTTPS change xml rpc URL http://api.mailchimp.com/1.3/ into https://api.mailchimp.com/1.3/

include mail chimp class into php mail sending form
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey



insert below php code after submit the form, into action script
$api = new MCAPI($apikey);
$merge_vars = array('FNAME'=>$_POST['Name'], 'LNAME'=>$_POST['Name'],
// 'GROUPINGS'=>array(
// array('name'=>'Your Interests:', 'groups'=>'Bananas,Apples'),
// array('id'=>22, 'groups'=>'Trains'),
//s )
);
// By default this sends a confirmation email - you will not see new members
// until the link contained in it is clicked!
$my_email = $_POST['Email'];
$boss_man_email = 'mailchimp@expertwebworld.com';
//$boss_man_email = 'mailchimp2@expertwebworld.com';
$retval = $api->listSubscribe( $listId, $my_email, $merge_vars );
if ($api->errorCode)
{
$mailchimperror='Error in newsletter subscription.';
// echo "Unable to load listSubscribe()!n";
//echo "tCode=".$api->errorCode."n";
//echo "tMsg=".$api->errorMessage."n";
} else {
$mailchimperror= "Subscribed - look for the confirmation email!n";
}


Bookmark and Share




Gallery

Related Topics

Comments



Submit Reviews:


(Enter the characters seen on the image below.)



Promotional Ads

Advertisement

Packers and Movers Service Chandigarh to Delhi
Gali No 1, Arya Nagar, Paharganj, New
Delhi

Maharaja Agrasen Hospital Super Speciality Hospital in Dwarka
H3VH+C7Q, Pocket 4, Sector 1 Dwarka, New Delhi 110075
Delhi

GET DIPLOMA IN DRESS DESIGNING| CONTACT-9810450615
A-100 3rd Floor, Mohan Garden, Nawada, opposite metro pillar no.747, near Uttam Nagar.
Delhi

PRIMARY TEACHER TRAINING(PTT)| SIPVS UTTAM NAGAR
A-100 3rd Floor, Mohan Garden, Nawada, opposite metro pillar no.747, near Uttam Nagar.
Delhi

Aplonis Healthcare
SCF-461, 1st floor
Motor Market, Sector-13,
Delhi

Jaggery Powder
431, Vijaya Lodge Building, Rangai Gowder Street, Town Hall, Coimbatore-641001, Tamil Nadu, India, Town Hall, Coimbatore-641001, Tamil Nadu, India
Coimbatore
Delhi

Self Drilling Anchor Bolt Systems
F-418 Office Block City Centre Mall Siliguri West Bengal - 734010
F-418 Office Block City Centre Mall Siliguri West Bengal - 734010
Delhi

Assured low-cost full body checkup at your home.
Mayur Colony, Kothrud
Pune
Delhi

HP Laptop Service Center in Dilshad Garden
197 B, Pocket F, Dilshad Gardenn Delhi,
Delhi

Interior A to Z
284/4, Chhatarpur Extension, Chhatarpur, New Delhi, Delhi 110074
Delhi
Delhi