While Marketing Cloud provides options to send email notifications upon completion, runtime, or skipped runs of an automation, there is often a challenge in obtaining a comprehensive view of all automations and their associated notification emails directly from the user interface.
Below Server-Side JavaScript (SSJS) script enables marketers and administrators to gain a comprehensive list of automations alongside their associated notification emails. A sample output table from the script looks like below:
<style> table { border-collapse: collapse; width: 100%; } th, td { border: 1px solid #ddd; padding: 8px; text-align: left; } th { background-color: #f2f2f2; } </style> <script runat="server"> Platform.Load("Core", "1.1.1"); // Initializing WSProxy to interact with the Marketing Cloud API var prox = new Script.Util.WSProxy(); // Define the columns to retrieve var cols = ["*", "Name", "CustomerKey"]; // Define a filter to retrieve automations with specific statuses var filter = { Property: "Status", SimpleOperator: "IN", Value: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8] }; // Retrieve automations based on the defined columns and filter var res = prox.retrieve("Automation", cols, filter); // Display the retrieved information in an HTML table Write('<table>'); Write('<tr>'); Write('<th>Automation Name</th>'); Write('<th>Notification Address</th>'); Write('<th>Notification Type</th>'); Write('</tr>'); // Iterate through the retrieved automations for (var i = 0; i < res.Results.length; i++) { var automation = res.Results[i]; // Check if Notifications field is available if (automation.Notifications) { // Iterate through the notifications of each automation for (var j = 0; j < automation.Notifications.length; j++) { var notification = automation.Notifications[j]; // Display automation and notification details in a table row Write('<tr>'); Write('<td>' + (res.Results[i].Name || "") + '</td>'); Write('<td>' + (notification.Address || "") + '</td>'); Write('<td>' + (notification.NotificationType || "") + '</td>'); Write('</tr>'); } } } Write('</table>'); </script>
<style> table { border-collapse: collapse; width: 100%; } th, td { border: 1px solid #ddd; padding: 8px; text-align: left; } th { background-color: #f2f2f2; } </style> <script runat="server"> Platform.Load("Core", "1.1.1"); // Initializing WSProxy to interact with the Marketing Cloud API var prox = new Script.Util.WSProxy(); // Define the columns to retrieve var cols = ["*", "Name", "CustomerKey"]; // Define a filter to retrieve automations with specific statuses var filter = { Property: "Status", SimpleOperator: "IN", Value: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8] }; // Retrieve automations based on the defined columns and filter var res = prox.retrieve("Automation", cols, filter); // Display the retrieved information in an HTML table Write('<table>'); Write('<tr>'); Write('<th>Automation Name</th>'); Write('<th>Notification Address</th>'); Write('<th>Notification Type</th>'); Write('</tr>'); // Iterate through the retrieved automations for (var i = 0; i < res.Results.length; i++) { var automation = res.Results[i]; // Check if Notifications field is available if (automation.Notifications) { // Iterate through the notifications of each automation for (var j = 0; j < automation.Notifications.length; j++) { var notification = automation.Notifications[j]; // Display automation and notification details in a table row Write('<tr>'); Write('<td>' + (res.Results[i].Name || "") + '</td>'); Write('<td>' + (notification.Address || "") + '</td>'); Write('<td>' + (notification.NotificationType || "") + '</td>'); Write('</tr>'); } } } Write('</table>'); </script>