Skip to content

Commit

Permalink
Add pipeline send_teams_message
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdatasourav committed Nov 30, 2023
1 parent eb722c2 commit 68e9edf
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
8 changes: 8 additions & 0 deletions simple/send_teams_message/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Send Teams Message

Send a new chat message in the specified channel.

## Usage

- Add your Teams Access token and ID to `flowpipe.pvars`
- Run the pipeline and specify the `channel_id` and `message` args, e.g., `flowpipe pipeline run send_teams_message --arg 'channel_id=944a8e14-7a6f-48c6-8805-6e93612f' --arg 'message=Hello world!'
2 changes: 2 additions & 0 deletions simple/send_teams_message/flowpipe.fpvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
access_token="<Acess Token>"
team_id="<Team ID>"
14 changes: 14 additions & 0 deletions simple/send_teams_message/mod.fp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mod "send_teams_message" {
title = "Send Teams Message"
description = "Send a new chat message in the specified channel."

require {
mod "github.com/turbot/flowpipe-mod-teams" {
version = "v0.0.1-rc.10"
args = {
access_token = var.access_token
team_id = var.team_id
}
}
}
}
49 changes: 49 additions & 0 deletions simple/send_teams_message/send_teams_message.fp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
pipeline "send_teams_message" {
title = "Send Teams Message"
description = "Send a new chat message in the specified channel."

param "access_token" {
type = string
description = "The Microsoft personal security access token to authenticate to the Microsoft graph APIs."
default = var.access_token
}

param "team_id" {
type = string
description = "The unique identifier of the team."
default = var.team_id
}

param "channel_id" {
type = string
description = "The channel's unique identifier."
}

param "message" {
type = string
description = "The message to send."
}

param "message_content_type" {
type = string
description = "The type of the content. Possible values are text and html."
optional = true
default = "text"
}

step "pipeline" "send_teams_message" {
pipeline = teams.pipeline.send_channel_message
args = {
access_token = param.access_token
team_id = param.team_id
channel_id = param.channel_id
message = param.message
message_content_type = param.message_content_type
}
}

output "message" {
value = step.pipeline.send_teams_message
description = "Channel message details."
}
}
9 changes: 9 additions & 0 deletions simple/send_teams_message/variables.fp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
variable "access_token" {
description = "The Microsoft personal security access token to authenticate to the Microsoft graph APIs."
type = string
}

variable "team_id" {
description = "The unique identifier of the team."
type = string
}

0 comments on commit 68e9edf

Please sign in to comment.