Hi, I am working on a Teams bot for my organization that sends notification to users from different tenants when we call an endpoint with a list of emails through an azure function.
We decided to update from teamsfx and I am trying to implement a way to save the email in our implementation of the storage because our goal is to notify users through azure functions based on their emails.
I made this snippet of code in the write function of my storage so I can save user email with their conversation reference:
let email;
await adapter.continueConversation(
conversationReference as ConversationReference,
async (turnContext) => {
try {
if (
turnContext.turnState.get('connectorClient') ===
undefined
) {
turnContext.turnState.set(
'connectorClient',
adapter.connectorClient,
);
}
turnContext.activity.channelData =
turnContext.activity.channelData ?? {};
const result = await TeamsInfo.getPagedMembers(
turnContext,
1,
undefined,
);
email = result.members[0].email;
} catch (error) {
throw error;
}
},
);
I have couple of issues here, I had to directly set the connectorClient in the context because sometimes it was not defined (same for the activity channel data). At the moment I am using @microsoft/agents-hosting-extensions-teams, @microsoft/agents-hosting, @microsoft/agents-activity v0.6.18 but I noticed that some pull requests were merged with updates to the two last packages but not the @microsoft/agents-hosting-extensions-teams.
Updating @microsoft/agents-hosting to version 1.0.0 creates types mismatches with agents-hosting-extensions-teams on TurnContext.
Furthermore I noticed that agents-hosting-extensions-teams has been removed for version 1.0.0 : #469.
Do you have any way of doing to succeed retrieving user email in a Teams notification bot with azure functions.
Hi, I am working on a Teams bot for my organization that sends notification to users from different tenants when we call an endpoint with a list of emails through an azure function.
We decided to update from teamsfx and I am trying to implement a way to save the email in our implementation of the storage because our goal is to notify users through azure functions based on their emails.
I made this snippet of code in the write function of my storage so I can save user email with their conversation reference:
I have couple of issues here, I had to directly set the connectorClient in the context because sometimes it was not defined (same for the activity channel data). At the moment I am using @microsoft/agents-hosting-extensions-teams, @microsoft/agents-hosting, @microsoft/agents-activity v0.6.18 but I noticed that some pull requests were merged with updates to the two last packages but not the @microsoft/agents-hosting-extensions-teams.
Updating @microsoft/agents-hosting to version 1.0.0 creates types mismatches with agents-hosting-extensions-teams on TurnContext.
Furthermore I noticed that agents-hosting-extensions-teams has been removed for version 1.0.0 : #469.
Do you have any way of doing to succeed retrieving user email in a Teams notification bot with azure functions.