Microsoft Tech Community Live:  Microsoft Teams Edition
November 09, 2021, 08:00 AM - 12:00 PM (PST)

Changing the "Posted a new message" notification

%3CLINGO-SUB%20id%3D%22lingo-sub-2701794%22%20slang%3D%22en-US%22%3EChanging%20the%20%22Posted%20a%20new%20message%22%20notification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2701794%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20recently%20written%20some%20code%20that%20sends%20an%20adaptive%20card%20through%20to%20Teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20the%20adaptive%20card%20arrives%20at%20Teams%2C%20a%20desktop%20notification%20shows%20stating%20%22ChatUser%20posted%20a%20new%20message%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22%22%3EI%20was%20wondering%20how%20to%20change%20the%20text%20of%20the%20notification%3F%20Can%20this%20be%20changed%20to%20show%20some%20other%20text%20from%20the%20adaptive%20card%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2701794%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ENotification%20Issues%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPop%20Up%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2727157%22%20slang%3D%22en-US%22%3ERe%3A%20Changing%20the%20%22Posted%20a%20new%20message%22%20notification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2727157%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F522791%22%20target%3D%22_blank%22%3E%40Jon_Monks%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EThe%20default%20notification%20can%20be%20changed%20by%20adding%20summary%20to%20the%20code%20as%20below%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Evar%20response%20%3D%20MessageFactory.Text(string.Empty)%3B%0Aresponse.Attachments.Add(cardAttachment)%3B%0Aresponse.Summary%20%3D%20%22Here%20goes%20your%20desired%20text%22%3B%0Aawait%20turnContext.SendActivityAsync(response%2C%20cancellationToken)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

We have recently written some code that sends an adaptive card through to Teams.

 

When the adaptive card arrives at Teams, a desktop notification shows stating "ChatUser posted a new message".

 

I was wondering how to change the text of the notification? Can this be changed to show some other text from the adaptive card?

1 Reply

@Jon_Monks 
The default notification can be changed by adding summary to the code as below:

 

var response = MessageFactory.Text(string.Empty);
response.Attachments.Add(cardAttachment);
response.Summary = "Here goes your desired text";
await turnContext.SendActivityAsync(response, cancellationToken);

 

Thanks, 

Prasad Das

------------------------------------------------------------------------------------------------------------------------ 

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.