Created
May 27, 2025 12:13
-
-
Save chrishow/5fa5774634f2bb561dbd80275d3ef66e to your computer and use it in GitHub Desktop.
Simple API to check Salesforce MCP data via cloudpages
This file contains hidden or 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
<script runat="server"> | |
Platform.Load("core","1"); | |
HTTPHeader.SetValue("Access-Control-Allow-Origin","*"); | |
HTTPHeader.SetValue("Content-Type","application/json"); | |
</script>%%[ | |
VAR @email, @rowCount | |
/* Capture email & competition from URL if passed */ | |
SET @email = RequestParameter("email") | |
/* Default values */ | |
SET @rowCount = 0 | |
/* Lookup email in the Data Extension */ | |
IF NOT EMPTY(@email) THEN | |
SET @rowCount = RowCount(LookupRows("Newsletter_Subscribers_NL", "email", @email)) | |
ENDIF | |
]%%{"email": "%%=v(@email)=%%", "count" : "%%=v(@rowCount)=%%", "version":"6"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment