2. Page Base Structure - Richard98PL/SFMC-Profile-Subscription-Center GitHub Wiki

  • Nav/Header
<nav>
  %%[
      SET @subscriptionCenterPageURL = CloudPagesURL(subscriptionNumber)
      SET @profileCenterPageURL = CloudPagesURL(profileNumber)
      SET @homePageURL = CloudPagesURL(homePageNumber)

      IF EMPTY(RequestParameter('email')) THEN
        Redirect(@homePageUrl)
      ELSE
        SET @salt = "e0cf1267f564b362" // 16 HEX Chars
        SET @password = "ourPassword" // String
        SET @initVector = "4963b7334a46352623252955df21d7f3" // 32 HEX Chars
        
        SET @emailDecryptedNotDecoded = RequestParameter('email')
        SET @emailDecrypted = DecryptSymmetric(Base64Decode(RequestParameter('email')), 
         "tripledes;mode=ecb;padding=ansix923", 
          @null, @password, 
          @null, @salt, 
          @null, @initVector
        )
      ENDIF
  ]%%
 <a href="%%=Concat(RedirectTo(@subscriptionCenterPageURL),'?email=',RequestParameter('email'))=%%">Subs Center Page</a>
 <a href="%%=Concat(RedirectTo(@profileCenterPageURL),'?email=',RequestParameter('email'))=%%">Profile Center Page</a>
</nav>
 
<head>
 <link rel="stylesheet" type="text/css" href="%%=CloudPagesURL(ourCssFileNumber)=%%">
 <script src="%%=CloudPagesURL(ourJSScriptNumber)=%%"></script>  
</head>
  • SSJS Template
<script type="text/javascript" runat="server">
   Platform.Load("core", "1");
   var email = Variable.GetValue("@emailDecrypted");
</script>
⚠️ **GitHub.com Fallback** ⚠️