I am creating a landing page with a form. On submit, the form passes variables to another landing page that will process and perform three different tasks, two of which are performing a TriggeredSend via InvokeCreate().
I am able to generate the TriggeredSend email, however when I attempt to pass through Attributes for the TS, I am met with the error:
Unable to queue Triggered Send request. There are no valid subscribers.
Here is my AMPscript:
%%[
VAR @emailaddr, @MembershipID, @Member_ID, @FirstName, @ts, @ts_def, @ts_externalkey, @ts_sub, @ts_attr, @ts_statusCode, @ts_statusMsg, @errorCode
SET @emailaddr = "[email protected]"
/* Retrieve the POST variables*/
SET @MembershipID = RequestParameter("MembershipID")
SET @Member_ID = RequestParameter("Member_ID")
SET @FirstName = RequestParameter("FirstName")
/* Create the Objects for the TriggeredSend*/
SET @ts = CreateObject("TriggeredSend")
SET @ts_def = CreateObject("TriggeredSendDefinition")
SetObjectProperty(@ts_def, "CustomerKey", "13323_01137")
SetObjectProperty(@ts, "TriggeredSendDefinition", @ts_def)
SET @ts_sub = CreateObject("Subscriber")
SetObjectProperty(@ts_sub, "EmailAddress", @emailaddr)
SetObjectProperty(@ts_sub, "SubscriberKey", @emailaddr)
SET @ts_attr = CreateObject("Attribute")
SetObjectProperty(@ts_attr, "Name", "Member_ID")
SetObjectProperty(@ts_attr, "Value", @Member_ID)
AddObjectArrayItem(@ts_sub, "Attributes", @ts_attr)
SET @ts_attr = CreateObject("Attribute")
SetObjectProperty(@ts_attr, "Name", "MembershipID")
SetObjectProperty(@ts_attr, "Value", @MembershipID)
AddObjectArrayItem(@ts_sub, "Attributes", @ts_attr)
SET @ts_attr = CreateObject("Attribute")
SetObjectProperty(@ts_attr, "Name", "FirstName")
SetObjectProperty(@ts_attr, "Value", @FirstName)
AddObjectArrayItem(@ts_sub, "Attributes", @ts_attr)
AddObjectArrayItem(@ts, "Subscribers", @ts_sub)
/*
SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode)
IF @ts_statusCode != "OK" THEN
VAR @CompleteRows, @RaiseErrorID
SET @CompleteRows = LookupRows("RaiseError_Log","StaticField","RaiseError")
SET @RaiseErrorID = ADD(RowCount(@CompleteRows),1)
InsertDE("RaiseError_Log","RaiseErrorID",@RaiseErrorID,"ClientID",memberid,"SendID",jobid,"SubscriberKey",_subscriberkey,"EmailAddress",emailaddr,"EmailName",emailname_,"ListID",listid,"ErrorDate",NOW(),"ErrorDescription",@errorCode)
RaiseError(@ts_statusMsg, 0, @ts_statusCode, @errorCode)
ELSE ]%%
The email seemed to have sent OK.
%%[ENDIF]%%
The TriggeredSend Interaction is set up using a Data Extension. I pass attributes directly to a TriggeredSend via SOAP - is this not possible with AMPscript?