Send pass links in Email Studio
Generate authenticated Wallet Crew pass links in Salesforce Marketing Cloud Email Studio with AMPscript.
How pass links work in Email Studio
Build the AMPscript block
%%[
var @tenant, @keyId, @json, @jwt, @email, @host
var @epochStart, @expirationDate, @secondsSinceEpoch, @secondsToEnd
set @keyId = '0000-00000000-0000000000-0000'
set @tenant = 'xxx'
set @email = Email
set @host = 'https://app.thewalletcrew.io'
set @epochStart = DateParse('1970/01/01 00:00AM')
set @expirationDate = DateAdd(Now(), '3', 'Y')
set @secondsSinceEpoch = Multiply(DateDiff(@epochStart, Now(), 'MI'), 60)
set @secondsToEnd = Multiply(DateDiff(@epochStart, @expirationDate, 'MI'), 60)
set @json = '{
"email":"@email",
"nbf": @secondsSinceEpoch,
"exp": @secondsToEnd,
"iat": @secondsSinceEpoch,
"iss": "neostore.cloud",
"aud": "@tenant"
}'
set @json = Replace(@json, '@secondsSinceEpoch', @secondsSinceEpoch)
set @json = Replace(@json, '@secondsToEnd', @secondsToEnd)
set @json = Replace(@json, '@tenant', @tenant)
set @json = Replace(@json, '@email', @email)
set @jwt = GetJWTByKeyName(@keyId, 'HS256', @json)
set @link = Concat(@host, '/', @tenant, '/pass?neo.authToken=', @jwt)
]%%Use another identifier when needed
Insert the link into content
Preview and validate
Troubleshooting
The link renders, but the token is empty
The link is rejected by The Wallet Crew
The wrong customer context opens
FAQ
Last updated

