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 = "myemailaddress@email.com"

/* 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)

    RaiseError(@ts_statusMsg, 0, @ts_statusCode, @errorCode)
ELSE ]%%

The email seemed to have sent OK.


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?

  • Are there any non-nullable values other than the ones you are passing? – Eduardo Arias Nov 19 '14 at 21:25
  • None. I'm noticing that when the data field "Member_ID" is present in the All Subscribers list under Profile Management - this TriggeredSend does not work. When I remove the "Member_ID" data field from Profile Management, this TriggeredSend does work. However, I have variable Sender Profiles using the Member_ID attribute from Data Extensions which require Member_ID to live in the All Subscribers list. – Daniel Nov 20 '14 at 2:41
  • Is it in a 2.0 account? If so, you might need to populate the Client property in TriggeredSend object. – Adam Spriggs Nov 20 '14 at 14:23
  • What type of field if the member_id profile attribute? Did you know you can also use a Triggered Send Data Extension so you don't need to fill your profile management section with attributes you might not need? – patosapir Mar 1 '17 at 22:06
  • @patosapir I don't think that's quite right; depends on whether you've selected to add people to All Subscribers (or any other list) in the Triggered Send Definition. If you have, you need to provide any required attributes. – David Murphy Aug 3 '17 at 3:49

First - you are on the right track using the ampscript on the landing page. It's easier that way versus trying to build out a soap call.

Provided that you are not adding to a list with the Triggered Send interaction - your syntax should work.

The error "no valid subscribers" means some data is not matching up in the TriggeredSend Data extension or the List you are adding to (nullable value in a non-nullable field, wrong data type like the DE has a number while the data has an alpha-numeric value - etc). You did a great job, because it seems you have isolated it to the Member_ID value.

I would try to first start by simply try to rename variables the variables you declared in the ampscript.

I've run into a problem where the variables could already been (what seems to be "secretly") declared as pre-defined system variables or already defined as an attribute. So the script could essentially be getting confused between what you are trying to call - the attribute/system variable called "Memeber_ID" or the variable called "Member_ID" in the ampscript which is housing the data you got from the URL.

Try This:
SET @MemID = RequestParameter("Member_ID")

Then in your build:
SET @ts_attr = CreateObject("Attribute")
SetObjectProperty(@ts_attr, "Name", "Member_ID")
SetObjectProperty(@ts_attr, "Value", @MemID)
AddObjectArrayItem(@ts_sub, "Attributes", @ts_attr)

You might want to also consider doing the same for @EmailAddr since %%EmailAddr%% is definitely a predefined system attribute.

Not saying it's the answer, but it might be worth a shot before you start dissecting the process.

| improve this answer | |

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.