Proposal for "ConstantContact"

» Metadata » Status
  • Category: Web Services
  • Proposer: James Benson 
  • License: PHP License 3.01
» Description
This standalone PHP class can be used to subscribe and unsubscribe members to a Constant Contact mailing list (http://constantcontact.com), it has no dependencies (apart from the allow_url_fopen setting) and gives access to their full API for subscribing/unsubscribing members aswell as updating their details.



Example Usage:


<?php

require_once 'ConstantContact.php';

$ConstantContact = new Services_ConstantContact();

$ConstantContact->setUsername('My CC Username'); /* set the constant contact username */
$ConstantContact->setPassword('My CC password'); /* set the constant contact password */
$ConstantContact->setCategory('CC Interest Category'); /* set the constant contact interest category */


// add a new subscriber, all we need is their email address, optional second parameter can be an array of extra data to send (see docs)
if($ConstantContact->add('someone@example.com')):
echo 'New subscriber successfully added ';
else:
echo 'Failed to add new subscriber ';
endif;


//remove a subscriber
if($ConstantContact->remove('someone@example.com')):
echo 'Subscriber successfully removed ';
else:
echo 'Failed to remove subscriber ';
endif;

?>
» Dependencies » Links
  • allow_url_fopen must be turned on in your php.ini
» Timeline » Changelog
  • First Draft: 2007-01-10
  • Proposal: 2007-01-10
  • Call for Votes: 2007-01-21
  • Voting Extended: 2007-01-29