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

Cloudpage reloading causing duplicate triggered send

$
0
0

I'm having an issue whereby i have a 'thank you' cloudpage which customer lands on after submitting a form in email. The cloudpage then sends a triggered send email.

The problem is that customers are receiving duplicate emails and according to MC support this is because the cloudpage is re-loading in micro secondswhich re-trigggers the email. I want to stop this from happening here is my AMPscript on the cloudpage

%%[SET @emailid = AttributeValue("emailaddr") SET @subKey = AttributeValue("_subscriberkey") VAR @ts, @tsDef, @ts_extkey, @ts_email, @ts_sub, @ts_statusCode, @ts_statusMsg, @errorCodeSET @ts = CreateObject("TriggeredSend")SET @tsDef = CreateObject("TriggeredSendDefinition")SET @ts_extkey = "Offeremail"SET @ts_email =  @emailid SetObjectProperty(@tsDef, "CustomerKey", @ts_extkey)SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef)SET @ts_sub = CreateObject("Subscriber")SetObjectProperty(@ts_sub, "EmailAddress", @ts_email)SetObjectProperty(@ts_sub, "SubscriberKey", @subKey)AddObjectArrayItem(@ts, "Subscribers", @ts_sub)SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode)IF @ts_statusCode != "OK" THEN  RaiseError(@ts_statusMsg, 0, @ts_statusCode, @errorCode)ENDIF]%%

Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>