free classified ads and leads
domain website price

Registered Users: 7487

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




Gallery

Related Topics

Comments



Submit Reviews:


(Enter the characters seen on the image below.)



Promotional Ads

Amazon Great Gifts Starting 45% Off Sale | Live Now >

Advertisement

ShreeJi Packers And Movers
415/1, IT Park Road, Shastri Nagar, Sector 13,

Packers and Movers in Zirakpur - Packers and Mover
SCO 3 AKS 2, Bhabat Rd, near Post Office, Zirakpur

Website Design and Development
Bangalore
Hyderabad

JF Engineering Products LLP
Parhar Village, Near Vasai Fata, Eastern Express Highway, Vasai (E), Palghar,
Motilal Nagar Mumbai

Nandishwar Steel
51 M.G. Mahimtura Marg, 3rd Kumbharwada Lane, Opp. Durgadevi Garden
August Kranti Marg Mumbai

Best Gastroenterologist in Ahmedabad
Ambika Chowk, Ramnagar Rd, Opposite Ramji Mandir, Sabarmati, Ahmedabad, Gujarat 380005
Ahmedabad

Lanco Pipes and Fittings
Shop No.1, Ground Floor, Plot No- 89 / 91, Shree Ram Mandir Marg, 4th Kumbharwada, Girgaon
August Kranti Marg Mumbai

ASIAD STEELS
59/ A, Ardeshir Dady Street, Nr. Alankar Cinema,Mumbai - 400 004, Maharashtra, .
Motilal Nagar Mumbai

THAPPAMARK
street no.4. 1ST floor 22/138, Motilal Nehru Road, near Mufid-E-Am Inter College, Agra, Uttar Pradesh 282004
Agra

Metal Yard
117, Bldg No.91, Durgadevi Street, 4th Kumbarwada Lane
Anu Shakti Nagar Mumbai