Email::ConstantContactPerl interface to the ConstantContact API | |
Download |
Email::ConstantContact Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Publisher Name:
- Adam Rich
- Publisher web site:
- http://search.cpan.org/~arich/
Email::ConstantContact Tags
Email::ConstantContact Description
Perl interface to the ConstantContact API Email::ConstantContact is a Perl module that allows you to interact with the ConstantContact mass email marketing service from Perl, such as creating and mainting contacts and contact lists.Before using this module, you must register your application with the ConstantContact company, agree to their terms & conditions, and apply for an API access key. You will use this key, in combination with a ConstantContact username and password to interact with the service. use Email::ConstantContact; my $apikey = 'ABCDEFG1234567'; my $username = 'mycompany'; my $password = 'topsecret'; my $cc = new Email::ConstantContact($apikey, $username, $password); # How to enumerate existing Contact Lists: my @all_lists = $cc->lists(); foreach my $list (@all_lists) { print "Found list: ", $list->{Name}, "\n"; } # How to create a new Contact List: my $new_list = $cc->newList('JAPH Newsletter', { SortOrder => '70', DisplayOnSignup => 'false', OptInDefault => 'false', }); # How to add a new contact: my $new_contact = $cc->newContact('jdoe@example.com', { FirstName => 'John', LastName => 'Doe', CompanyName => 'JD Industries', ContactLists => , }); # How to modify existing contact: my $old_contact = $cc->getContact('yogi@example.com'); print "Yogi no longer works for ", $old_contact->{CompanyName}, "\n"; $old_contact->{CompanyName} = 'Acme Corp'; # Enumerate List Membership print "Member of Lists: \n"; foreach my $listid (@{ $old_contact->{ContactLists} }) { my $listobj = $cc->getList($listid); print $listobj->{Name}, "\n"; } # Manage List Membership $old_contact->removeFromList($some_list_id); $old_contact->clearAllLists(); $old_contact->addToList($new_list); $old_contact->save(); # Opt-Out of all future emails $old_contact->optOut(); $old_contact->save(); # Display recent activities my @recent_activities = $cc->activities(); foreach my $activity (@recent_activities) { print "Found recent activity, Type= ", $activity->{Type}, "Status= ", $activity->{Status}, "\n"; } Requirements: · Perl
Email::ConstantContact Related Software