1.0.2 • Published 4 years ago

@evokegroup/msteams v1.0.2

Weekly downloads
9
License
ISC
Repository
bitbucket
Last release
4 years ago

@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

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago