Email::ExactTarget::SubscriberOperations
Version 1.3.5
# Create a new subscriber operations object my $subscriber_operations = $exact_target->subscriber_operations(); my $subscribers; eval { $subscribers = $subscriber_operations->retrieve( 'email' => [ qw( test@test.invalid foo@bar.invalid ) ], ); }; warn "Retrieving the subscribers failed: $@" if $@;
Creates a new SubscriberOperations object, requires an Email::ExactTarget object to be passed as parameter.
my $subscriber_operations = Email::ExactTarget::SubscriberOperations->new( $exact_target );
Note that this is not the recommended way of creating a SubscriberOperations object. If you are writing a script using this distribution, you should use instead:
my $subscriber_operations = $exact_target->subscriber_operations();
Returns the main Exact Target object.
my $exact_target = $subscriber_operations->exact_target();
Creates a new subscriber in ExactTarget's database using the staged changes on the subscriber objects passed as parameter.
$subscriber_operations->create( \@subscribers );
Creates a new subscriber in ExactTarget's database using the staged changes on the subscriber objects passed as parameter. If the subscriber already exists in the database, updates it.
$subscriber_operations->update_or_create( \@subscribers );
Applies to ExactTarget's database any staged changes on the subscriber objects passed as parameter.
$subscriber_operations->update( \@subscribers );
Retrieves from ExactTarget's database the subscribers corresponding to the unique identifiers passed as parameter.
my @subscriber = $subscriber_operations->retrieve( 'email' => [ $email1, $email2 ], );
Pulls from ExactTarget's database the list subscriptions for the arrayref of subscribers passed as parameter.
$subscriber_operations->pull_list_subscriptions( $subscribers );
Deletes permanently the subscribers in the set passed as parameter from ExactTarget's database.
Note that this operation cannot be reversed. If you want to keep the subscribers but make sure emails are never sent to them, look into adding them to the "blacklist" list instead.
my $all_subscribers_removed = $subscriber_operations->delete_permanently( \@subscribers ); unless ( $all_subscribers_removed ) { foreach my $subscriber ( @subscribers ) { my $errors = $subscriber->errors(); if ( defined( $errors ) ) { # We failed to delete the subscriber. print 'Failed to update subscriber ', $subscriber->id(), ": ", Dumper( $errors ); } else { # Success. } } }
Internal. Updates or create a set of subscribers.
my $batch_success = $subscriber_operations->_update_create( 'subscribers' => \@subscriber, 'soap_action' => 'Update', 'soap_method' => 'UpdateRequest', ); my $batch_success = $subscriber_operations->_update_create( 'subscribers' => \@subscriber, 'soap_action' => 'Create', 'soap_method' => 'CreateRequest', );
Note $batch_success will be true only if all the elements have been updated successfully. When it is false, you should loop through @subscriber and use the errors() method on each object to find which one(s) failed.
errors()
Formats the lists subscription changes passed as a hashref for inclusion in the SOAP messages.
my $soap_lists = $self->_soap_format_lists( $lists );
See http://wiki.memberlandingpages.com/API_References/Web_Service_Guide/_Technical_Articles/Managing_Subscribers_On_Lists.
Formats the attributes passed as a hashref for inclusion in the SOAP messages.
my $soap_attributes = $self->_soap_format_attributes( $attributes );
Guillaume Aubert, <aubertg at cpan.org>.
<aubertg at cpan.org>
Please report any bugs or feature requests to bug-email-exacttarget at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Email-ExactTarget. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-email-exacttarget at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Email::ExactTarget::SubscriberOperations
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Email-ExactTarget
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Email-ExactTarget
CPAN Ratings
http://cpanratings.perl.org/d/Email-ExactTarget
Search CPAN
http://search.cpan.org/dist/Email-ExactTarget/
Thanks to ThinkGeek (http://www.thinkgeek.com/) and its corporate overlords at Geeknet (http://www.geek.net/), for footing the bill while I eat pizza and write code for them!
Copyright 2009-2012 Guillaume Aubert.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Email::ExactTarget, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Email::ExactTarget
CPAN shell
perl -MCPAN -e shell install Email::ExactTarget
For more information on module installation, please visit the detailed CPAN module installation guide.