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]%%