free classified ads and leads
domain website price


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";
}



See here how to build the form and send email using it with code examples . PHP Email Contact Form
Bookmark and Share




Gallery

Related Topics

Comments



Submit Reviews:


(Enter the characters seen on the image below.)



Promotional Ads

Advertisement

Packers and movers in Mohali
Plot No 636, Near HP Gas Agency, Dariya, Chandigarh - 160101
Mohali

Submersible Sludge Pumps
18, shreenath Estate, cross road, nr. Nikol, nr. Sardar Patel Ring Road, Kathwada, Gujarat 382415
Ahmedabad

Bhakti Bird Proofing
House no.9479 durgamata tekdi vibhag, mahalaxmi nagar, City ambernath, Near durgamata temple. Pin Code-421501
Motilal Nagar Mumbai

Livonta Global Pvt.Ltd
1110, Colonnade, B/H Iscon Temple, Opp. Iscon BRTS Bus Stand
Iscon - Ambali Rd,
Ahmedabad

Brij Agnihotri & associates company secretaries
3454, 40D, Sector 40D, Chandigarh, 160036, India

JB Rock Bolts & SN BOLTS
10 A & B Industrial Area (at Vill. Nangal Jarialan)
Distt. Una Himachal Pradesh
Una

Govinda resorts Lonavala
Old Mumbai - Pune Hwy, Maval, Lonavala, Maharashtra 410405
Lonavla

Steelco Metal & Alloys
192 – Minara Mansion, Shop No.6, Sant Sena Maharaj Marg, 2nd Kumbharwada Lane, Mumbai, Maharashtra 400004
Mumbra Mumbai

Best Resorts in Dharamshala Amid the Misty Hills.
SATOBARI HILLS ROAD,MCLEODGANJ,
Dharamshala

Genius Global School
194 Anand Vihar Saproon, Solan, Himachal Pradesh
Ambala Cantt