To include Server-Side JavaScript (SSJS) in an email message, you need to use the <script> tag with the runat="server" attribute. This ensures that the script runs on the server side before the email is sent.
* <script runat=server></script>: This is a valid way to include SSJS in an email. It specifies that the enclosed code should be executed on the server.
<script runat="server"> Platform.Load("Core","1"); var rows = Platform.Function.LookupRows ("DataExtensionName", "EmailAddress", "
[email protected]"); </script>
1: Salesforce SSJS Documentation
<script runat=server language=javascript></script>: This is another valid syntax. It specifies that the code within the script tag is JavaScript and should run on the server.
<script runat="server" language="javascript"> Platform.Load("Core","1"); var rows = Platform.Function.
LookupRows("DataExtensionName", "EmailAddress", "
[email protected]"); </script> Reference: Salesforce SSJS Documentation