2.0.9 • Published 2 years ago

@truongezgg/nest-teams-webhook v2.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@truongezgg/nest-teams-webhook

Library for sending webhook messages to Microsoft Teams chanel

Installation

npm i @truongezgg/nest-teams-webhook

Quick start

Prepare URL Send notification on a Microsoft Teams channel from a Data Factory pipeline

  1. Module
import { TeamsWebhookModule } from '@truongezgg/nest-teams-webhook';
import { Module } from '@nestjs/common';


@Module({
  imports: [
    TeamsWebhookModule.register("CHANEL_WEBHOOK_URL_HERE")
  ],
  controllers: [],
  providers: [],
})
export class ExampleModule {}
  1. Service
@Injectable()
export class ExampleService {
  constructor(private readonly teamsWebhookService: TeamsWebhookService) {}

  async sendMessage() {
      // Send message
      await this.teamsWebhookService.sendMessage("Hello, this is message");
  }

  async sendMessageCard() {
      // Template OTP
      await this.teamsWebhookService.sendMessageCard({
          title: "Webhook message",
          subtitle: "Forgot password",
          facts: {
            "Environment": "development",
            "Phone": "0123456789",
            "Verification code": "123456",
            "Expires at": "2022-01-01T00:00:00Z"
          }
      });
  }

  async sendRaw() {
      // Send without custom body
      await this.teamsWebhookService.sendRaw({ text: "This is raw message" });
  }

}
2.0.9

2 years ago

2.0.8

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago