Socket
Book a DemoInstallSign in
Socket

@evokegroup/msteams

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evokegroup/msteams

Helper for sending message to a Microsoft Teams channel

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
3
Created
Source

@evokegroup/msteams

Helper for sending message to a Microsoft Teams channel

Class: MSTeams

constructor(url)

ParameterTypeDefaultDescription
urlstringThe channel's webhook URL

Methods

sendCard(card)

ParameterTypeDefaultDescription
cardMSTeams.CardThe card to send

Usage

const MSTeams = require('@evokegroup/msteams');

const card = new MSTeams.Card({
  title: 'Title', 
  text: 'Message text'
});

const msTeams = new MSTeams('https://outlook.office.com/webhook');

msTeams.sendCard(card)
.then(() => {
  // Card sent
})
.catch((ex) => {
  console.log(ex);
});

sendMessage(object)

ParameterTypeDefaultDescription
titlestringThe card title
textstringThe card text

Usage

const MSTeams = require('@evokegroup/msteams');

const msTeams = new MSTeams('https://outlook.office.com/webhook');

msTeams.sendMessage({
  title: 'Title', 
  text: 'Message text'
})
.then(() => {
  // Card sent
})
.catch((ex) => {
  console.log(ex);
});

Static Methods

send(object)

ParameterTypeDefaultDescription
urlstringThe channel's webhook URL
cardMSTeams.CardThe card to send
titlestringThe card title if card is undefined
textstringThe card text if card is undefined

Usage

const MSTeams = require('@evokegroup/msteams');

MSTeams.send({
  url: 'https://outlook.office.com/webhook',
  title: 'Title',
  text: 'Message text'
});

Class: MSTeams.Card

constructor(object)

ParameterTypeDefaultDescription
titlestringThe card title
textstringThe card text

Properties

PropertyTypeDescription
titlestringThe card title
textstringThe card text

Methods

serialize()

Serializes the card

FAQs

Package last updated on 05 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts