这是indexloc提供的服务,不要输入任何密码
Skip to content

How do I make a mentioned message in Teams (Workflows) ? #1326

@masukatto0281

Description

@masukatto0281

Question

I would like to mention with @user during the message.
Send to the channel in the team.
Mentions to yourself will be notified, but mentions to others will not be recognized correctly.

Use action: Post card in a chat or channel
Post as: User
Post in: Channel

Code:

webhook_url = 'https://prod-NO.LOCATION.logic.azure.com:443/workflows/WFID/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=SIGNATURE'

apobj = apprise.Apprise(debug=True)
apobj.add(webhook_url)

title = 'Message title'
# This will be mentioned. (To me)
message = 'Hello, @<at>me@example.com</at>! This is a message body.'
# But, This will not be mentioned. (To another member)
message = 'Hello, @<at>foo@example.com</at>! This is a message body.'

response = apobj.notify(
  title=title,
  body=message,
  notify_type=apprise.NotifyType.INFO,
  body_format=apprise.NotifyFormat.MARKDOWN,
  attach=None,
)

I think I need to set the msteams property to make the mentions.
How can I set such a json format in Apprise?

https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format#mention-support-within-adaptive-cards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions