Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions bigfunctions/notify/send_teams_message.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,10 @@ code: |
if not message:
return 'EMPTY MESSAGE. NOT SENDING'
assert webhook_url.startswith('https://') and '.webhook.office.com/' in webhook_url, 'webhook_url should start with `https://<xxxxx>.webhook.office.com/`'
response = requests.post(
webhook_url,
headers={'Content-Type': 'application/json; charset=UTF-8'},
json={
'type': 'message',
'attachments': [{
'contentType': 'application/vnd.microsoft.card.adaptive',
'content': {
'type': 'AdaptiveCard',
'body': [{'type': 'TextBlock', 'text': message, 'wrap': True}],
'msTeams': {'width': 'full'},
'$schema': 'http://adaptivecards.io/schemas/adaptive-card.json',
'version': '1.4'
}
}]
})
response = requests.post(webhook_url,
headers={'Content-Type': 'application/json; charset=UTF-8'},
json={'text': message}
)
assert response.ok, 'ERROR: ' + response.text
return response.text
requirements: |
Expand Down
Loading