Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

Trigger Email on Cloud Page Form submission

$
0
0

I changed the logic using single page and only triggering the email. Now, form is submitted but data is not added in Trigger DE and Trigger Email is also not sent.

if RequestParameter("submitted") == "submitted" thenSET @ts = CreateObject("TriggeredSend")SET @tsDef = CreateObject("TriggeredSendDefinition")SET @ts_extkey = "12188314"SET @ts_email = RequestParameter("EmailAddress")SET @ts_subkey = _subscriberkeySetObjectProperty(@tsDef, "CustomerKey", @ts_extkey)SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef)SET @ts_sub = CreateObject("Subscriber")SetObjectProperty(@ts_sub, "EmailAddress", @ts_email)SetObjectProperty(@ts_sub, "SubscriberKey", @ts_subkey)AddObjectArrayItem(@ts, "Subscribers", @ts_sub)SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode)IF @ts_statusCode != "OK" THENRaiseError(@ts_statusMsg, 0, @ts_statusCode, @errorCode)ENDIFENDIF

Added the HTML as below

<form action="https://pub.s10.exacttarget.com/2d0my0f2vky"  method="POST"><label>Email Address</label><input type="EmailAddress" id="EmailAddress" required="required" name="EmailAddress" value=""><input id="submitted" type="hidden" name="submitted" value="submitted" /><input type="submit" value="Submit"></form>

Viewing all articles
Browse latest Browse all 359

Trending Articles