Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Created November 24, 2019 19:36
Show Gist options
  • Save zuzannamj/3d0a7eadea75bf0d44df10ee74eecb3c to your computer and use it in GitHub Desktop.
Save zuzannamj/3d0a7eadea75bf0d44df10ee74eecb3c to your computer and use it in GitHub Desktop.
%%[
VAR @ts, @tsDef, @ts_extkey, @ts_email, @ts_sub, @ts_statusCode, @ts_statusMsg, @errorCode
SET @ts = CreateObject("TriggeredSend")
SET @tsDef = CreateObject("TriggeredSendDefinition")
SET @ts_extkey = "ExternalKey" /* use the external key of the interaction for example SET @ts_extkey = "49078" */
SET @ts_email = "[email protected]" /* provide recipient's email address */
SetObjectProperty(@tsDef, "CustomerKey", @ts_extkey)
SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef)
SET @ts_sub = CreateObject("Subscriber")
SetObjectProperty(@ts_sub, "EmailAddress", @ts_email)
SetObjectProperty(@ts_sub, "SubscriberKey", @ts_email)
AddObjectArrayItem(@ts, "Subscribers", @ts_sub)
Output(InvokeCreate(@ts, @ts_statusMsg, @errorCode))
]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment