Closed MOKknudsen closed 2 years ago
Right now PSTeams supports only Message Cards using Incoming Webhook and not Graph API. It doesn't support Mentions. However, this is an interesting subject for me. Maybe I should pursue this.
In the meantime, you could try using: https://www.powershellgallery.com/packages/Microsoft.Graph.Teams.Chats straight from Microsoft :-)
I would really appreciate if you could look into this. I’m really happy with your work in PSTeams 😊
Med venlig hilsen | Best Regards Morten Waltorp Knudsen CEO & Senior Consultant [cid:image011.jpg@01D6129D.005B57C0]https://2linkit.net/wp-content/uploads/2018/02/53A1809.jpg [cid:image012.png@01D6129D.005B57C0] +45 40 178 179<tel:+45%2040%20178%20179> [cid:image013.png@01D6129D.005B57C0] MOK@2LINKIT.NETmailto:MOK@2linkit.net [cid:image014.png@01D6129D.005B57C0] [cid:image015.png@01D6129D.005B57C0] [cid:image016.png@01D6129D.005B57C0] [cid:image017.png@01D6129D.005B57C0] [cid:image018.png@01D6129D.005B57C0] [cid:image019.png@01D6129D.005B57C0]http://www.2linkit.net/ Strandvejen 21A 6000 Kolding Denmark 2linkIT QuickSupport (TeamViewer) https://get.teamviewer.com/2linkit-supporthttps://get.teamviewer.com/2linkit-support
From: Przemysław Kłys notifications@github.com Sent: 14. april 2020 20:35 To: EvotecIT/PSTeams PSTeams@noreply.github.com Cc: Morten Waltorp Knudsen MOK@2LINKIT.NET; Author author@noreply.github.com Subject: [EXT] Re: [EvotecIT/PSTeams] How can I make a post with a mention, so IT dept gets notifications about the post (#17)
Right now PSTeams supports only Message Cards using Incoming Webhook and not Graph API. It doesn't support Mentions. However, this is an interesting subject for me. Maybe I should pursue this.
In the meantime, you could try using: https://www.powershellgallery.com/packages/Microsoft.Graph.Teams.Chatshttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FMicrosoft.Graph.Teams.Chats&data=02%7C01%7Cmok%402linkit.net%7C1821a2dbc8a242af3bdb08d7e0a27f98%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224860851060873&sdata=b26inEKNJg1SeqWgN9SmoO17kcP5qmhvLECijiZx2wQ%3D&reserved=0 straight from Microsoft :-)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEvotecIT%2FPSTeams%2Fissues%2F17%23issuecomment-613609944&data=02%7C01%7Cmok%402linkit.net%7C1821a2dbc8a242af3bdb08d7e0a27f98%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224860851060873&sdata=AlkzowjGreH12er1Q4hXlRuAi9io6rfOkLvk2FAFjLw%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKIF7YPME3QLNTNYNLYC6LLRMSUEDANCNFSM4MH4ICSQ&data=02%7C01%7Cmok%402linkit.net%7C1821a2dbc8a242af3bdb08d7e0a27f98%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224860851070829&sdata=rj4iBsXAOWo68Djy32V7QzLXgTvVSpx1358gqjMDg0k%3D&reserved=0.
How can I attach file to the post in teams?
Med venlig hilsen | Best Regards Morten Waltorp Knudsen CEO & Senior Consultant +45 40 178 179 MOK@2LINKIT.NET Strandvejen 21A 6000Kolding Denmark 2linkIT QuickSupport (TeamViewer) https://get.teamviewer.com/2linkit-support
Fra: Przemysław Kłys notifications@github.com Sendt: Tuesday, April 14, 2020 8:34:41 PM Til: EvotecIT/PSTeams PSTeams@noreply.github.com Cc: Morten Waltorp Knudsen MOK@2LINKIT.NET; Author author@noreply.github.com Emne: [EXT] Re: [EvotecIT/PSTeams] How can I make a post with a mention, so IT dept gets notifications about the post (#17)
Right now PSTeams supports only Message Cards using Incoming Webhook and not Graph API. It doesn't support Mentions. However, this is an interesting subject for me. Maybe I should pursue this.
In the meantime, you could try using: https://www.powershellgallery.com/packages/Microsoft.Graph.Teams.Chatshttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FMicrosoft.Graph.Teams.Chats&data=02%7C01%7Cmok%402linkit.net%7C1821a2dbc8a242af3bdb08d7e0a27f98%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224860851060873&sdata=b26inEKNJg1SeqWgN9SmoO17kcP5qmhvLECijiZx2wQ%3D&reserved=0 straight from Microsoft :-)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEvotecIT%2FPSTeams%2Fissues%2F17%23issuecomment-613609944&data=02%7C01%7Cmok%402linkit.net%7C1821a2dbc8a242af3bdb08d7e0a27f98%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224860851060873&sdata=AlkzowjGreH12er1Q4hXlRuAi9io6rfOkLvk2FAFjLw%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKIF7YPME3QLNTNYNLYC6LLRMSUEDANCNFSM4MH4ICSQ&data=02%7C01%7Cmok%402linkit.net%7C1821a2dbc8a242af3bdb08d7e0a27f98%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224860851070829&sdata=rj4iBsXAOWo68Djy32V7QzLXgTvVSpx1358gqjMDg0k%3D&reserved=0.
It's not supported in Message Cards, It may be supported by Graph API
It appears so:
You can post messages with card attachments referencing existing SharePoint files using the Microsoft Graph APIs for OneDrive and SharePointhttps://docs.microsoft.com/en-us/onedrive/developer/rest-api/. Using the Graph APIs requires obtaining access to a user's OneDrive folder (for personaland groupchat files) or the files in a team's channels (for channel files) through the standard OAuth 2.0 authorization flow.
Please have a look at Send and receive fileshttps://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-files#using-the-microsoft-graph-apisdocumentation.
Med venlig hilsen | Best Regards Morten Waltorp Knudsen CEO & Senior Consultant +45 40 178 179 MOK@2LINKIT.NET Strandvejen 21A 6000Kolding Denmark 2linkIT QuickSupport (TeamViewer) https://get.teamviewer.com/2linkit-support
Fra: Przemysław Kłys notifications@github.com Sendt: Tuesday, April 14, 2020 10:52:50 PM Til: EvotecIT/PSTeams PSTeams@noreply.github.com Cc: Morten Waltorp Knudsen MOK@2LINKIT.NET; Author author@noreply.github.com Emne: [EXT] Re: [EvotecIT/PSTeams] How can I make a post with a mention, so IT dept gets notifications about the post (#17)
It's not supported in Message Cards, It may be supported by Graph API
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEvotecIT%2FPSTeams%2Fissues%2F17%23issuecomment-613675553&data=02%7C01%7Cmok%402linkit.net%7Cfea19e153ae44e3b0de808d7e0b5ccac%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224943745084110&sdata=xuP7GR%2B84DV0bDz2AnSqhB3eZrhxCmD22mXEUJmfiMs%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKIF7YPRJWC52LKCDHVIEITRMTEKFANCNFSM4MH4ICSQ&data=02%7C01%7Cmok%402linkit.net%7Cfea19e153ae44e3b0de808d7e0b5ccac%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224943745084110&sdata=taMw2KvDiAz6Jr1gYVmny3e26PiLHUlTCG4mMXOvmTo%3D&reserved=0.
Hi again, Do you have any experience in integrating Flow/Power apps workflow with an approval proces. Example:
Med venlig hilsen | Best Regards Morten Waltorp Knudsen CEO & Senior Consultant [cid:image011.jpg@01D61408.0BE047B0]https://2linkit.net/wp-content/uploads/2018/02/53A1809.jpg [cid:image012.png@01D61408.0BE047B0] +45 40 178 179<tel:+45%2040%20178%20179> [cid:image013.png@01D61408.0BE047B0] MOK@2LINKIT.NETmailto:MOK@2linkit.net [cid:image014.png@01D61408.0BE047B0] [cid:image015.png@01D61408.0BE047B0] [cid:image016.png@01D61408.0BE047B0] [cid:image017.png@01D61408.0BE047B0] [cid:image018.png@01D61408.0BE047B0] [cid:image019.png@01D61408.0BE047B0]http://www.2linkit.net/ Strandvejen 21A 6000 Kolding Denmark 2linkIT QuickSupport (TeamViewer) https://get.teamviewer.com/2linkit-supporthttps://get.teamviewer.com/2linkit-support
From: Przemysław Kłys notifications@github.com Sent: 14. april 2020 22:53 To: EvotecIT/PSTeams PSTeams@noreply.github.com Cc: Morten Waltorp Knudsen MOK@2LINKIT.NET; Author author@noreply.github.com Subject: [EXT] Re: [EvotecIT/PSTeams] How can I make a post with a mention, so IT dept gets notifications about the post (#17)
It's not supported in Message Cards, It may be supported by Graph API
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEvotecIT%2FPSTeams%2Fissues%2F17%23issuecomment-613675553&data=02%7C01%7Cmok%402linkit.net%7Cfea19e153ae44e3b0de808d7e0b5ccac%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224943745084110&sdata=xuP7GR%2B84DV0bDz2AnSqhB3eZrhxCmD22mXEUJmfiMs%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKIF7YPRJWC52LKCDHVIEITRMTEKFANCNFSM4MH4ICSQ&data=02%7C01%7Cmok%402linkit.net%7Cfea19e153ae44e3b0de808d7e0b5ccac%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637224943745084110&sdata=taMw2KvDiAz6Jr1gYVmny3e26PiLHUlTCG4mMXOvmTo%3D&reserved=0.
PSTeams is not going to help you with that, at least not in the near future.
is it possible to get a URL link to the message, I post to Teams, so I can refer to it e.g. in a planner task just below my post
Med venlig hilsen | Best Regards Morten Waltorp Knudsen CEO & Senior Consultant [cid:image011.jpg@01D619C2.C0EA51E0]https://2linkit.net/wp-content/uploads/2018/02/53A1809.jpg [cid:image012.png@01D619C2.C0EA51E0] +45 40 178 179<tel:+45%2040%20178%20179> [cid:image013.png@01D619C2.C0EA51E0] MOK@2LINKIT.NETmailto:MOK@2linkit.net [cid:image014.png@01D619C2.C0EA51E0] [cid:image015.png@01D619C2.C0EA51E0] [cid:image016.png@01D619C2.C0EA51E0] [cid:image017.png@01D619C2.C0EA51E0] [cid:image018.png@01D619C2.C0EA51E0] [cid:image019.png@01D619C2.C0EA51E0]http://www.2linkit.net/ Strandvejen 21A 6000 Kolding Denmark 2linkIT QuickSupport (TeamViewer) https://get.teamviewer.com/2linkit-supporthttps://get.teamviewer.com/2linkit-support
From: Przemysław Kłys notifications@github.com Sent: 16. april 2020 19:53 To: EvotecIT/PSTeams PSTeams@noreply.github.com Cc: Morten Waltorp Knudsen MOK@2LINKIT.NET; Author author@noreply.github.com Subject: [EXT] Re: [EvotecIT/PSTeams] How can I make a post with a mention, so IT dept gets notifications about the post (#17)
PSTeams is not going to help you with that, at least not in the near future.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEvotecIT%2FPSTeams%2Fissues%2F17%23issuecomment-614802314&data=02%7C01%7Cmok%402linkit.net%7C26bb87193a9947683beb08d7e22f0a9b%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637226563984690627&sdata=NZI0g5aUIDhZmsVcVZQYe4UBIjU3uVViKZEnzYQCErQ%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKIF7YLV2P5G7PTLDM5G6B3RM5AYXANCNFSM4MH4ICSQ&data=02%7C01%7Cmok%402linkit.net%7C26bb87193a9947683beb08d7e22f0a9b%7Cf0fa27a08e7c4f639a77ec94786b7c9e%7C1%7C0%7C637226563984690627&sdata=ywqPlBLQvwi8khRf4LVDsPwA2WMyMheF6DgoB3SVdtA%3D&reserved=0.
Don't think so.
It looks like MS Teams now support mention within Adaptive Card
I'll verify this, but:
So it says bots and messaging extensions - what we do may not be applicable. And i you check my tries from months back I was using the code they propose
But maybe they enabled it in the backend and we just need to check things.
but the user doesn't receive any notification they've been tagged. Note:
ok, super cool. Time to add it I guess :)
Well, it seems not much have changed
It still acts the same 1 year later
I guess I can add it, and when it's really usable it will just start working.
Mentions added:
New-AdaptiveCard -Uri $Env:TEAMSPESTERID -VerticalContentAlignment center {
New-AdaptiveTextBlock -Size ExtraLarge -Weight Bolder -Text 'Test' -Color Attention -HorizontalAlignment Center
New-AdaptiveColumnSet {
New-AdaptiveColumn {
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1' -Color Dark
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1' -Color Light
}
New-AdaptiveColumn {
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1' -Color Warning
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1' -Color Good
}
New-AdaptiveColumn {
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1 <at>Name</at>' -Color Warning
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1 <at>Zenon Jaskuła</at>' -Color Warning
}
}
New-AdaptiveMention -Text 'Zenon Jaskuła' -UserPrincipalName 'przemyslaw.klys@evotec.test'
New-AdaptiveMention -Text 'Name' -UserPrincipalName 'przemyslaw.klys@evotec.test'
} -Verbose #-SelectAction Action.OpenUrl -SelectActionUrl 'https://evotec.xyz'
But it's a bit useless because mention is mention, but without notification ;/
Closing, hopefully things will start working automatically once Microsoft enables it.
Mention notifications now work and have tested the above code - all good.
Great! I just tested and it seems to work, with just one issue - you need
New-AdaptiveColumn {
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1 <at>Name</at>' -Color Warning
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1 <at>Przemysław Kłys</at> Przemysław Kłys' -Color Warning
}
It seems the implementation should be: "text": "Hi <at>Adele UPN</at>, <at>Adele AAD</at>"
so it would seem you need to do both?
I'm not sure exactly what you mean by "you need chars are removed along with the data so you need to add additional text" but I think I know what you mean. This worked for me, outputting "Hello Robin" only (but I get the notification, and that's the tag text):
New-AdaptiveCard -Uri $TeamsID -FullWidth -VerticalContentAlignment center {
New-AdaptiveTextBlock -Size ExtraLarge -Weight Bolder -Text 'Test' -Color Attention -HorizontalAlignment Center
New-AdaptiveColumnSet {
New-AdaptiveColumn {
New-AdaptiveTextBlock -Size 'Medium' -Text 'Test Card Title 1'
}
New-AdaptiveColumn {
New-AdaptiveTextBlock -Size 'Medium' -Text 'Hello Robin <at>Robin Malik</at>'
}
}
New-AdaptiveMention -Text 'Robin Malik' -UserPrincipalName 'username@domain.com'
}
I think the documentation is just being a little lazy, using a single TextBlock to generate/link to two methods of tagging/notifying users.
Right, so you need to add text you want to display and at the same time at
How can I make a post with a mention, so IT dept gets notifications about the post
https://myteamsday.com/2019/03/05/sending-message-with-atmention-onto-a-channel-using-graphapi/