How to change notification text when bot sends an adaptive card in Microsoft Teams?

Published Dec 01 2020 08:28 AM 2,254 Views

When bot sends an adaptive card, Microsoft Teams notification sent a "Sent a card" message.

Like shown below: 

Capture.PNG

Capture.PNG

To send custom summary in place of "Sent a card" edit following values... 

 

 var response = MessageFactory.Text(string.Empty);
 response.Attachments.Add(cardAttachment);
 response.Summary = "showing custom greeeting from the Bot - rather than a card";
 await turnContext.SendActivityAsync(response, cancellationToken);

 

Once we add a summary as shown, it will not show "sent a card" message in teams and even in the notification we'll not see "sent a card", we'll get a summary message. 

 

Result: 

Capture.PNG

And in notification: 

Capture.PNG

 

 

 

%3CLINGO-SUB%20id%3D%22lingo-sub-1945008%22%20slang%3D%22en-US%22%3EHow%20to%20change%20notification%20text%20when%20bot%20sends%20an%20adaptive%20card%20in%20Microsoft%20Teams%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1945008%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20bot%20sends%20an%20adaptive%20card%2C%20Microsoft%20Teams%20notification%20sent%20a%20%22Sent%20a%20card%22%20message.%3C%2FP%3E%0A%3CP%3ELike%20shown%20below%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.PNG%22%20style%3D%22width%3A%20344px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F236929iE0227E39C25D4F09%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.PNG%22%20style%3D%22width%3A%20284px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F236930i857BEC3233E15CF6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ETo%20send%20custom%20summary%20in%20place%20of%20%22Sent%20a%20card%22%20edit%20following%20values...%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3E%20var%20response%20%3D%20MessageFactory.Text(string.Empty)%3B%0A%20response.Attachments.Add(cardAttachment)%3B%0A%20response.Summary%20%3D%20%22showing%20custom%20greeeting%20from%20the%20Bot%20-%20rather%20than%20a%20card%22%3B%0A%20await%20turnContext.SendActivityAsync(response%2C%20cancellationToken)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20we%20add%20a%20summary%20as%20shown%2C%20it%20will%20not%20show%20%22sent%20a%20card%22%20message%20in%20teams%20and%20even%20in%20the%20notification%20we'll%20not%20see%20%22sent%20a%20card%22%2C%20we'll%20get%20a%20summary%20message.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EResult%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.PNG%22%20style%3D%22width%3A%20567px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F236932iB9EEF4AB7AFD4FF3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAnd%20in%20notification%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.PNG%22%20style%3D%22width%3A%20490px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F236935i26EDB108DEA57977%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1945008%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20bot%20sends%20an%20adaptive%20card%2C%20Microsoft%20Teams%20notification%20sent%20a%20%22Sent%20a%20card%22%20message.%3C%2FP%3E%0A%3CP%3ELike%20shown%20below%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.PNG%22%20style%3D%22width%3A%20344px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F236929iE0227E39C25D4F09%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.PNG%22%20style%3D%22width%3A%20284px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F236930i857BEC3233E15CF6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.PNG%22%20alt%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Version history
Last update:
‎Dec 01 2020 08:30 AM
Updated by: