Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $attributes = array(
- 'Double_Opt_in' => true,
- 'Double_Opt_in_Date' => date('d.m.Y h:m'),
- 'Double_Opt_in_IP' => $_SERVER['REMOTE_ADDR'],
- 'Checkin_opt_in' => true,
- 'Country_Code' => '',
- 'Language' => ''
- );
- $client = new ExactTargetSoapClient("$wsdl", array('trace' => 1));
- $client->username = "$username";
- $client->password = "$password";
- $subscriber = new ExactTarget_Subscriber();
- $subscriber->EmailAddress = $email;
- $subscriber->SubscriberKey = $email;
- $Double_Opt_in = new ExactTarget_Attribute();
- $Double_Opt_in->Name = "Double_Opt_in";
- $Double_Opt_in->Value = 'true';
- $Double_Opt_in_Date = new ExactTarget_Attribute();
- $Double_Opt_in_Date->Name = "Double_Opt_in_Date";
- $Double_Opt_in_Date->Value = date('m.d.Y h:i');
- $Double_Opt_in_IP = new ExactTarget_Attribute();
- $Double_Opt_in_IP->Name = "Double_Opt_in_IP";
- $Double_Opt_in_IP->Value = $_SERVER['REMOTE_ADDR'];
- $subscriber->Attributes = array(
- $Double_Opt_in,
- $Double_Opt_in_Date,
- $Double_Opt_in_IP,
- );
- $subscriber->Lists = array();
- $list->ID = "123456";
- $subscriber->Lists[] = $list;
- $so = new ExactTarget_SaveOption();
- $so->PropertyName = "*";
- $so->SaveAction = ExactTarget_SaveAction::UpdateAdd;
- $soe = new SoapVar($so, SOAP_ENC_OBJECT, 'SaveOption', "http://exacttarget.com/wsdl/partnerAPI");
- $opts = new ExactTarget_UpdateOptions();
- $opts->SaveOptions = array($soe);
- $object = new SoapVar($subscriber, SOAP_ENC_OBJECT, 'Subscriber', "http://exacttarget.com/wsdl/partnerAPI");
- $request = new ExactTarget_CreateRequest();
- $request->Options = $opts;
- $request->Objects = array($object);
- $results = $client->Create($request);
- write_log($results);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement