1

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 :)

1

Double Opt-in and Welcome emails defined for a list are for use with Web Collect. Adding subscriber to the list via API will not initiate those emails.

More details on Web Collect: http://help.marketingcloud.com/en/documentation/exacttarget/subscribers/web_collect/

It is possible to do double opt-in through the API using a Triggered Send. Create an email that contains the double opt-in link

http://cl.exct.net/sub_confirm.asp?lst=%%List_%%&eml=%%EmailAddr_%%&mid=%%MemberID%%

Then setup a Triggered Send Definition which uses that email, make sure that the Send Classification is setup as Transactional and insure that under Subscriber Management the list they need to be opted into is select with "Add to List" and "Update subscribers" checked.

On the API side, a single request to trigger the email is required, be sure to include the Status of Unsubscribed on the subscribe record to prevent them from being added as Active.

<CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
   <Options/>
   <Objects xsi:type="TriggeredSend">
      <PartnerKey xsi:nil="true"/>
      <ObjectID xsi:nil="true"/>
      <TriggeredSendDefinition>
         <PartnerKey xsi:nil="true"/>
         <ObjectID xsi:nil="true"/>
         <CustomerKey>TSDoubleOptIn</CustomerKey>
      </TriggeredSendDefinition>
      <Subscribers>
         <PartnerKey xsi:nil="true"/>
         <ObjectID xsi:nil="true"/>
         <EmailAddress>example@example.com</EmailAddress>
         <SubscriberKey>example@example.com</SubscriberKey>
         <EmailTypePreference>HTML</EmailTypePreference>
         <Status>Unsubscribed</Status>
         <Attributes>
            <Name>First Name</Name>
            <Value>Mac</Value>
         </Attributes>
      </Subscribers>
   </Objects>
</CreateRequest>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.