Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • 1 Votes
    1 Posts
    46 Views
    No one has replied
  • 1 Votes
    4 Posts
    310 Views
    L

    In case anyone needs it, I added support to dismiss the notification.

    After the if node, assuming true, add another connection, a 'Loop over items' node, with a batch size of 1.

    Connect the node's "loop" connection to a new function node with this code.

    // Access the input JSON data const item = $json; // Ensure the structure is correct and 'filteredID' exists if (item.filteredID && Array.isArray(item.filteredID) && item.filteredID.length > 0) { const notificationId = item.filteredID[0]; // Extract the first ID // Return the data for the HTTP Request node return { json: { notificationId: notificationId, acknowledged: true } }; } else { throw new Error("Invalid JSON structure or 'filteredID' not found."); }

    Then, connect the function node to a new HTTP request node with the method of 'POST', URL of "https://my.cloudron.site/api/v1/notifications/{{ $json.notificationId }}" (As an expression), same authorization header as the first HTTP request nodes, with the (JSON) body of:

    { "acknowledged": true }

    I'm pretty sure this process can be written better, but this approach was quick and dirty. I've also adjusted the notifications to be sent via email rather than using NFTY, but that's a pretty straightforward step.

    0338dc53-6d5a-4d2b-9071-5849f552439b-image.png