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


Bookmark and Share




Gallery

Related Topics

Comments



Submit Reviews:


(Enter the characters seen on the image below.)



Promotional Ads

Advertisement

The Moscow City Haridwar
NH-58, Adj. Radha Swami Satsang Bhawan, Delhi- Haridwar Express Way
Bahadrabaad
Haridwar

Him Hotel
Village Banala, Post Office Panarsa, District Mandi , Himachal Pradesh 175121
Mandi

The Palace Banquet Hall
Derabassi - Barwala Rd,
Ramgarh, Haryana
Derabassi

Austin Pharmaceuticals GMP and WHO certified
E-40, Industrial Focal Point
Dera bassi
Mohali

Direct AWS
7718 Green Garland Drive
Springfield
Williamsburg

Woodville High School
11 Actil Avenue
St Clair SA 5011
Adelaide

Cedar College
215-233 Fosters Rd Northgate
South Australia 5085
Adelaide

Adelaide High School
West Terrace Adelaide
South Australia 5000
Adelaide

ALARSIN (PHARMACEUTICALS)
A/32 Street No. 3
M.I.D.C. Andheri (East)
Mumbai

ALICE PHARMA PVT. LTD.
A-302 Everest Nivara Infotech Park
MIDC Main Road Indira Nagar Turbhe
Navi Mumbai