Created
August 9, 2021 16:51
-
-
Save MyCueCards/d03ed61dfaef17da8bde4ca350d1a4d8 to your computer and use it in GitHub Desktop.
Basic example of AMPScript SHA256() function, returning SHA256 hash tag based on the string value
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
%%[ | |
SET @CheckForEmail = IsEmailAddress(_SubscriberKey) | |
IF @CheckForEmail == 'false' THEN | |
SET @FinalSubscriberKey = _SubscriberKey | |
ELSE | |
SET @FinalSubscriberKey = SHA256(_SubscriberKey,'UTF-16') | |
ENDIF | |
SET @Link = CONCAT('https://[DomainStuffHere]?mcsubkey=', @FinalSubscriberKey) | |
]%% | |
<p> | |
<strong>Staging URL with AMPScript =</strong> <a href="%%=RedirectTo(@Link)=%%">%%=RedirectTo(@Link)=%%</a> | |
</p> | |
<p> | |
<strong>1. SubscriberKey (original) =</strong> %%_SubscriberKey%% | |
<br> | |
<strong>2. SubscriberKey (if email true) =</strong> %%=v(@FinalSubscriberKey)=%% | |
</p> | |
<hr> | |
<p> | |
Salesforce Documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/SHA256.htm | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment