Forum Discussion
themashcodee2
Dec 27, 2023Copper Contributor
How to send dm even if the user has not installed the app in personal scope.
I am trying to build a bot which will have a few message extension to submit data and then I will make a request to my custom backend. I want to save the data and want to send dm to the user. I am...
- Dec 27, 2023Hello themashcodee2- Thanks for raising your query.
For a user to receive proactive messages, install the app for the user or make the user a part of a team in which the app is installed.
You can also, proactively install your app using Graph.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#proactively-install-your-app-using-graph
You can refer this sample as well: https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/graph-proactive-installation/csharp
Please refer this documentation: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#create-the-conversation
ChetanSharma-msft
Microsoft
Dec 27, 2023Hello themashcodee2- Thanks for raising your query.
For a user to receive proactive messages, install the app for the user or make the user a part of a team in which the app is installed.
You can also, proactively install your app using Graph.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#proactively-install-your-app-using-graph
You can refer this sample as well: https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/graph-proactive-installation/csharp
Please refer this documentation: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#create-the-conversation
For a user to receive proactive messages, install the app for the user or make the user a part of a team in which the app is installed.
You can also, proactively install your app using Graph.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#proactively-install-your-app-using-graph
You can refer this sample as well: https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/graph-proactive-installation/csharp
Please refer this documentation: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#create-the-conversation
- themashcodee2Dec 27, 2023Copper ContributorThanks Chetan! These documentations really helped me a lot.
I tried the notification bot sample from vscode teams toolkit extension and it is able to send a dm to a user without requiring the user to install the app so it solved my problem.
Please let me know if notification bot process is wrong for my use case.- ChetanSharma-msftDec 27, 2023
Microsoft
Actually, it depends on your requirement, but this is one of the correct approaches.
Please share your valuable feedback via Microsoft Teams Developer Feedback link.- themashcodee2Dec 27, 2023Copper ContributorOh Okay.
One last question, is there a way I can create a group chat and also invite the bot into it at the time so that I can send a message to that group chat later?
Thanks, I shared the feedback via link.