Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ms teamsv2 rendering issues #4160

11 changes: 8 additions & 3 deletions notify/msteamsv2/msteamsv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,23 @@ type Notifier struct {
postJSONFunc func(ctx context.Context, client *http.Client, url string, body io.Reader) (*http.Response, error)
}

type MSTeams struct {
Width string `json:"width"`
}

// https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1#adaptivecarditemschema
type Content struct {
Schema string `json:"$schema"`
Type string `json:"type"`
Version string `json:"version"`
Body []Body `json:"body"`
Msteams Msteams `json:"msteams,omitempty"`
MSTeams MSTeams `json:"msTeams, omitempty"`
}

type Body struct {
Type string `json:"type"`
Text string `json:"text"`
Weight string `json:"weigth,omitempty"`
Weight string `json:"weight,omitempty"`
Size string `json:"size,omitempty"`
Wrap bool `json:"wrap,omitempty"`
Style string `json:"style,omitempty"`
Expand Down Expand Up @@ -170,9 +174,10 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
{
Type: "TextBlock",
Text: text,
Wrap: true,
},
},
Msteams: Msteams{
MSTeams: MSTeams{
Width: "full",
},
},
Expand Down