Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Created September 27, 2019 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuzannamj/6edd0a125a387409245e89e93cae6a6a to your computer and use it in GitHub Desktop.
Save zuzannamj/6edd0a125a387409245e89e93cae6a6a to your computer and use it in GitHub Desktop.
%%[
VAR @subscriberkey, @email, @firstname, @lastname
SET @subscriberkey = _subscriberkey
IF NOT EMPTY(@subscriberkey) THEN
SET @rs= RetrieveSalesforceObjects("Contact", "Id, FirstName,LastName,Email", "Id", "=", @subscriberkey)
SET @rowCount = rowcount(@rs)
IF @rowCount > 0 THEN
SET @row = row(@rs,1)
SET @email = field(@row,"Email")
SET @firstname = field(@row,"FirstName")
SET @lastname = field(@row,"LastName")
ENDIF
ELSE
SET @email = emailaddr
SET @firstname = ""
SET @lastname = ""
ENDIF
]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment