Some one just answered the question in stackOverFlow here is the link
How to send adaptive card through outlook with botFramework NodeJs
I've built a bot that sends adaptive cards through teams. I'm able to successfuly interact with the card. However, I would like to extend the functionality and make it capable to send cards through outlook as well. I have followed this steps and added the channel to the azure bot services. However, I do not know how to start sending the card because its not explained in the documentation. Here is the snipped of how I send the card to teams.
// HTTP trigger to send notification. You need to add authentication / authorization for this API. Refer https://aka.ms/teamsfx-notification for more details.
server.post(
"/api/notificationByTeams",
restify.plugins.queryParser(),
restify.plugins.bodyParser(), // Add more parsers if needed
async (req, res) => {
let continuationToken = undefined;
do {
const pagedData = await notificationApp.notification.getPagedInstallations();
let adaptiveCardData = req.body;
const { MerlinUser, MerlinPassword, Receivers, TemplateType } = adaptiveCardData;
//Here we get all the users receiving the notification
const usersReceivingCardInformation = await getNotificationMembersInfoByEmail(Receivers)
const installations = pagedData.data;
continuationToken = pagedData.continuationToken;
//Here we encrypt the data of the admin user
adaptiveCardData.MerlinUser = encryptData(MerlinUser);
adaptiveCardData.MerlinPassword = encryptData(MerlinPassword);
adaptiveCardData.Originator = process.env.Originator;
console.info("Llegamos a setear el originator ", adaptiveCardData.Originator);
adaptiveCardData.UserIds = usersReceivingCardInformation.map(x => x.id);
for (const target of installations) {
if (target.type === "Person" && usersReceivingCardInformation.some(x => x.id === target.conversationReference.user.id)) {
let selectedTemplate = selectTemplate(TemplateType);
await target.sendAdaptiveCard(
AdaptiveCards.declare(selectedTemplate).render({
...adaptiveCardData
})
);
}
}
} while (continuationToken);
res.json({});
}
);
I added the outlook channels to my bot service in azure. here is the link of the Stackoverflow post. https://stackoverflow.com/questions/78649276/how-to-send-adaptive-card-through-outlook-with-botframework-nodejs
Do I need to use graph service to send adaptive cards to outlook?