Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards

Custom Alert Activity Functionality

Avatar

Level 3

Hi,

 

We would like to implement functionality to send Adobe Campaign alerts to a Microsoft Teams channel via webhook: Create an Incoming Webhook - Teams | Microsoft Learn

 

How can we edit the under-the-hood functionality of the "alert" activity and the workflow supervisor "alert" for workflow failures to add a condition which triggers a webhook message via javascript?

 

  • Where is the "alert" activity executed / where is the functionality stored, and is it editable?
  • Has anyone successfully done this?

Thanks,

Skyler

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Community Advisor

Hello @SkylerQu2 

 

With Alert activity you can use a javascript activity to send an alert to Microsoft teams. 

Here is the sample code you can use in Javascript activity.

 

var webhookUrl = "https://xxxxx.webhook.office.com/xxxxxxxxx";

// Create the payload
var formatted_Card_Payload = {
    type: "message",
    attachments: [
        {
            contentType: "application/vnd.microsoft.card.adaptive",
            contentUrl: null,
            content: {
                $schema: "http://adaptivecards.io/schemas/adaptive-card.json",
                type: "AdaptiveCard",
                version: "1.2",
                body: [
                    {
                        type: "TextBlock",
                        text: "Submitted response:" + response
                    }
                ]
            }
        }
    ]
};

// Convert to JSON string
var payloadString = JSON.stringify(formatted_Card_Payload);

// Create request
var xhr = new HttpClientRequest(webhookUrl);
xhr.header["Content-Type"] = "application/json";
xhr.method = "POST";
xhr.body = payloadString;

try {
    var response = xhr.execute();
    logInfo("Webhook sent. Response code: " + response.code);
    logInfo("Response body: " + response.body);
} catch (e) {
    logError("Error sending webhook: " + e);
}

     Manoj
     Find me on LinkedIn