Last active
November 24, 2019 19:26
-
-
Save zuzannamj/f640a04247e07ae44d7087d01f63ffbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
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" | |
SET @ts_email = "email@example.com" | |
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) | |
SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode) | |
IF @ts_statusCode != "OK" THEN | |
RaiseError(@ts_statusMsg, 0, @ts_statusCode, @errorCode) | |
ENDIF | |
]%% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment