To be clear, are you trying to send a proactive message to the user's emails? It would be easier to help if we understood what you were actually trying to do. It's possible to proactively message your team through Teams, by building your own conversation ID.
Hi ,
Yes I'm trying to send the proactive messages to user using activity.from.id(uniqueID) coming from Teams.
This is how I am sending proactive message:-
TenantInfo Tenant = new TenantInfo();
Tenant.Id = TenantID;//teams ID
ConnectorClient connectorClient = new ConnectorClient(new Uri(serviceUrl), msBotID, msBotPassword);
ConversationParameters parameters = new ConversationParameters
{
Bot = new ChannelAccount(botId, botName),
Members = new ChannelAccount[] { new ChannelAccount(UserUniqueID) }, //unique user id (Guid) coming from teams.(saving in database when user chats with bot) .
ChannelData = new TeamsChannelData
{
Tenant = Tenant
}
};
ConversationResourceResponse conversationResource = await connectorClient.Conversations.CreateConversationAsync(parameters);
var message = Activity.CreateMessageActivity();
message.From = new ChannelAccount(botId, botName);
message.Conversation = new ConversationAccount(id: conversationResource.Id.ToString());
message.Text ="Hello, This is the notification in Teams...";
await connectorClient.Conversations.SendToConversationAsync((Activity)message);
Hello,
My issue is similar to this :- https://github.com/microsoft/botframework-sdk/issues/4312
@Chekrii as an option, you can try to install an app for the user and try to get chat to trigger memberAdded event. Sample code https://github.com/OfficeDev/msteams-sample-contoso-hr-talent-app/blob/master/TeamsTalentMgmtApp/src/TeamsTalentMgmtAppV4/Services/GraphApiService.cs#L43
We provide a sample demonstrating how to query the roster, and proactively message members of a team: https://github.com/microsoft/BotBuilder-Samples/blob/master/samples/csharp_dotnetcore/57.teams-conversation-bot/Bots/TeamsConversationBot.cs#L103
@Chekrii, did @Ky7m and @EricDahlvang 's solutions help you?
HI @jwiley84 ,
Thanks a lot. It helped me.
Alright! I'm going to go ahead an close this issue. If you have further issues, please feel free to open new tickets, here or on stack overflow!
Most helpful comment
We provide a sample demonstrating how to query the roster, and proactively message members of a team: https://github.com/microsoft/BotBuilder-Samples/blob/master/samples/csharp_dotnetcore/57.teams-conversation-bot/Bots/TeamsConversationBot.cs#L103