I'm trying to set up the double opt in feature for registering the users for news letter via API. It's a must according to our law.
I'm using the SOAP Client and I set the attributes and calls via PHP.
I have set up the attributes and everything.The users are being added to the list successfully, however they don't receive the confirmation email. And also the weird thing is that the status of the users are "Active" when they are added to the list on exact target account. According to the documentation, for Double-Opt-in registrations, the user should be added to the list with "Unsubscribed" status and once they clicked the confirmation link in their email then their status should be updated to "Active". To work around this, I enforced the user to be added to the list with "Unsubscribed" status hoping that it might do the trick but no avail. And still the user doesn't receive any confirmation email.
As for the side information, the Double-Opt-in feature is enabled for the list and also the email template with the right confirmation url is also up and set. Everything seems as it supposed to be but still the users are unable to receive confirmation email.
This is how I set the attributes and add the users to the list: (I just wrote part of my code that is relevant to my case)
$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);
Any help is highly appreciated! I'm looking forward to your responses :)