I'm trying to trigger a "Triggered Send" from when a user clicks on a link in an email. At the moment I'm passing users through to a CloudPage, inserting their info into a Triggered Send DE and then trying to send them a triggered email that has the audience of the Triggered Send DE.
I'm getting a 500 error on the cloud page but I can see them being inserted into the DE. I assume my trigger code is incorrect.
Here is my code;
%%[ SET @customerId = RequestParameter('customerId') SET @customerType = RequestParameter('customerType') SET @Email = RequestParameter('Email') IF @customerId != '' THEN InsertDE('Welcome_Journey_Trigger','SubscriberKey', @customerId,'CustomerType', @customerType,'EmailAddress', @Email,) SET @ts = CreateObject("TriggeredSend") SET @tsDef = CreateObject("TriggeredSendDefinition") SetObjectProperty(@tsDef, "CustomerKey", 5869) SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef) SET @ts_sub = CreateObject("Subscriber") SetObjectProperty(@ts_sub, "EmailAddress", @Email) SetObjectProperty(@ts_sub, "SubscriberKey", @Email) SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode) IF @ts_statusCode != 'OK' THEN RaiseError(@ts_statusMsg, 0, @ts_statusCode, @errorCode) ENDIF ENDIF ]%%
Any help would be greatly appreciated. Thanks.