Skip to content

Calls & messaging

Post risky signup alerts to Microsoft Teams

Post an Adaptive Card to a Teams channel when a signup email is undeliverable or disposable, through a Workflows webhook instead of retired Office 365 connectors.

Updated 2026-11-26

This recipe posts a card to a Microsoft Teams channel each time your signup backend finds an undeliverable or disposable email address. Teams receives the card through a workflow built with the Workflows app, which replaced the Office 365 connectors that Microsoft retired. There is no Qelka app for Teams: your backend checks the email with the API, then sends one HTTPS request to the workflow.

What you need

  • Microsoft Teams with the Workflows app, and permission to post in the alert channel. If Workflows is missing, your admin may have restricted it.
  • A backend that already checks each signup, for example as in the Node.js integration. The code below uses the built-in fetch of Node.js 18 or later; any language that sends an HTTPS POST works.
  • A Qelka API key on that backend. A sk_test_ key returns simulated results and never spends credits: see Test mode.

The API key never goes into Teams or the workflow. Only the workflow's URL goes to your backend.

Steps

1. Create the workflow

  1. In Teams, go to the alert channel, select More options (...) next to its name, then Workflows.
  2. Search for the template Send webhook alerts to a channel and select it.
  3. Check the team and channel, then select Save.
  4. Copy the webhook URL shown once the workflow is created.

The template builds a flow that starts with the When a Teams webhook request is received trigger and posts the card it receives. You can build the same flow by hand in Power Automate with that trigger and the Teams action Post card in a chat or channel, which lets you choose a private channel or add steps such as a condition.

Templates differ in who may call the URL. The plain template accepts a request without a Microsoft sign-in, so the URL itself is the secret: anyone who has it can post in your channel. The variants that only accept specific people or people in your organization require a Microsoft Entra token on every request, which a backend service rarely has. Keep the URL in a secret store, and if it leaks, delete the workflow and create a new one.

2. Store the URL

bash
TEAMS_WEBHOOK_URL=https://your-workflow-url-copied-from-teams
QELKA_API_KEY=sk_test_your_key

Set both as environment variables or secrets on the host that runs your backend, never in code that reaches a browser.

3. Send the card

Call this function after your signup check, with the email and the API result. It does not wait for Teams, so a Teams problem never slows down or blocks a signup:

javascript
export function alertTeams(email, result) {
  const disposable = result.status === 'risky' && result.reason === 'disposable'
  if (result.status !== 'undeliverable' && !disposable) return
  const shown = result.reason === 'invalid_syntax' ? '(invalid syntax, not shown)' : email
  const card = {
    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: disposable ? 'Disposable email at signup' : 'Undeliverable email at signup',
              weight: 'Bolder',
              size: 'Medium',
              wrap: true,
            },
            {
              type: 'FactSet',
              facts: [
                { title: 'Email', value: shown },
                { title: 'Reason', value: result.reason },
                { title: 'Suggestion', value: result.did_you_mean ?? 'none' },
                { title: 'Lookup', value: result.id },
              ],
            },
          ],
        },
      },
    ],
  }
  post(card).catch((error) => console.error('teams alert failed', error.message))
}

async function post(card, attempt = 1) {
  const response = await fetch(process.env.TEAMS_WEBHOOK_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(card),
    signal: AbortSignal.timeout(10000),
  })
  if ((response.status === 429 || response.status >= 500) && attempt < 3) {
    await new Promise((resolve) => setTimeout(resolve, attempt * 2000))
    return post(card, attempt + 1)
  }
  if (!response.ok) console.error(`teams workflow answered ${response.status}`)
}

The envelope is the part that differs from the old connectors. The workflow trigger expects an object with type set to message and an attachments array, where each item has contentType set to application/vnd.microsoft.card.adaptive, contentUrl set to null and the Adaptive Card itself in content. That is the request schema Microsoft documents for the trigger, so send exactly this shape rather than an old connector payload.

Teams renders basic Markdown in card text and ignores HTML. The address comes from a stranger, and one that failed the syntax check can hold the brackets and parentheses of a Markdown link, so shown hides it in that case. A well-formed address cannot contain them.

4. Test it

Send a card from your terminal to check the workflow before wiring the backend:

bash
curl -X POST "$TEAMS_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"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":"Workflow test"}]}}]}'

The card should appear in the channel. If it does not, open the workflow's run history in the Workflows app or in Power Automate: a failed run shows which step refused the payload. Then sign up on staging with a test key using disposable@example.com and nomx@example.com, which return risky with disposable and undeliverable with domain_no_mx in both full and fast mode.

Decide what to post

Result Meaning Card
undeliverable Bad syntax, no domain or no mailbox Posted, with the suggestion when there is one
risky, reason disposable A throwaway inbox Posted
risky, other reasons Catch-all domain or full mailbox Not posted: these are often real people
deliverable The mail server accepted the mailbox Not posted
unknown The checks could not conclude Not posted: not a bad address
API error The check did not run Not posted; your signup code logs it and lets the person in

The card informs people; blocking is for your signup code. See Block disposable email signups and the reasons in the email reference.

Handle errors and rate limits

On the API side, nothing is billed on errors. Your signup check should end as unchecked on any failure, log the error type and the X-Request-Id, and let the person through: no card is posted for a check that did not run. A key allows 200 requests per 10 seconds and returns 429 with Retry-After beyond it. Each email check costs 1 credit. See Errors and Rate limits.

On the Teams side, Microsoft documents a 28 KB message size limit and throttling when a webhook receives more than four requests per second. The Teams connector behind the workflow has its own per-connection limits, and posting as the Flow bot is limited to a few dozen calls per five minutes. These numbers are Microsoft's and may change, but the conclusion holds: Teams is not built for one card per event at volume. If signups arrive in bursts, collect the flagged addresses for a few minutes and send one card that lists them. Each alert contains a personal email address, so post to a private channel limited to the people who need it.

Frequently asked questions

Can I still use an Office 365 connector incoming webhook?
No. Microsoft retired Office 365 connectors in Teams, connector-based incoming webhooks included, and points to the Workflows app instead. A Workflows webhook takes the same kind of JSON card, but its URL and payload wrapper differ, so an old connector URL has to be replaced, not just re-pasted.
Do I need a Power Automate premium license?
Not for this. Microsoft states that the Teams webhook templates and the When a Teams webhook request is received trigger do not require a premium license. Your organization can still restrict Workflows or Power Automate, so check with your Microsoft 365 admin if the Workflows option is missing.
What happens to the alerts if the person who built the workflow leaves?
A workflow belongs to its owners, not to the team or the channel. Microsoft warns that a workflow without an owner becomes an orphan and can stop. Add a co-owner when you create it, and make the alert channel's owner one of them.

More in Calls & messaging

All integrations

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.

  • 100 free credits a month
  • No card
  • Test keys spend nothing
  • Cancel any time