Notify to Teams on Firebase events

Microsoft Teams

Google Firebase

npm install --save axios
const axios = require(‘axios’);
exports.notifyNewUser = functions.auth.user().onCreate((user) => {};
const webHook = "https://outlook.office.com/webhook/....";const curDate = new Date();
var card = {
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "New User Created"
},
{
"type": "FactSet",
"facts": [
{
"title": "Create Date",
"value": curDate.toISOString()
},
{
"title": "UUID",
"value": user.uid
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
}
}
]
};
axios.post(webHook, card)
.catch(error => {
console.error(error)
});
firebase deploy --only functions

Test

--

--

--

System Operator and DevOPs Architect since childhood

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

5 Beginner Interview Questions in Javascript

Using Routes and Links in ReactJS

Yes,you can create art out of triangles too!

【鬼灭之刃 剧场版 无限列车篇 完整版本(2020-HD) Kimetsu no Yaiba: Mugen Ressha-Hen 完整版鬼灭之刃 剧场版 无限列车篇 Kimetsu no…

An investigative guide to React JS[DOM, Virtual DOM and JSX] Part-V

6 powerful React libraries to try in 2021

How to design GraphQL custom scalars

Create PDF with Bar-Codes in PHP using FPDF

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Stefan Steinert

Stefan Steinert

System Operator and DevOPs Architect since childhood

More from Medium

Communication Through WhatsApp Business Cloud API In KitaJaga.co

Flutter And Why It Could Be The Future Of Mobile App Development

Why Flutter Could Be The Future Of Mobile App Development

How to Choose Best Cross Platform App Development Framework in 2022?

Designing of Mobile App based Mathematical Games