web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send email with userna...
Power Automate
Answered

Send email with username and body content of message from a Teams channel?

(0) ShareShare
ReportReport
Posted on by 8

Hey all! I'm trying to create a simple email system that is sent out whenever an agent sends a message in the "Help" channel and says a specific keyword (in this case, "aux").

 

The goal is to have agents send the messauge AUX, and then power automate to reply with a bot message and then send an email to a specific set of people with the users name and message content.

 

Seems the only way to get the message content and username ID is to add "get messages" however doing so gets ALL messages, and while there is a way to filter for the specified keyword, it still enters all of the user messages that include the keyword and replies to the one message but then sends an email per every other teams message.

 

This is what I would like to happen:

 

Agent types: Hey, I need help with my aux state, can someone help?

Bot reply in MS Teams: Hey! An email has been sent to the team, please keep an eye out for a reply

Email sent from PA to team: Subject: Aux request, Body: Hey, USERNAME requests an aux check. Here is the following message content: MESSAGECONTENT

 

I apologize for lack of pictures, I am using mobile and its not working. My workplace prevents access from outside of the iMac so I dont have direct access to it from my iMac either. Weird situation but I do have access to allowing bots and stuff (and have it working for other keywords)

Categories:
I have the same question (0)
  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @mvfsullivan 

     

    There is a new Teams trigger that will look for a value in a channel message.  You can then get the message details and see who the sender was as well as get the message content.

     

    DamoBird365_0-1631565200748.png

    Flow will attempt to put you into an apply to each.  So I have used first() as follows:

     

    first(triggerOutputs()?['body/value'])?['messageid']
    first(triggerOutputs()?['body/value'])?['teamid']
    first(triggerOutputs()?['body/value'])?['channelid']
     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • mvfsullivan Profile Picture
    8 on at

    I did exactly as you have and testing results in "Not Found". 

     

    It does give me the ability to insert body content / username in the email body section but testing doesnt move past the messageid not found.

     

    Am I doing something wrong?

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @mvfsullivan ,

     

    Are you getting an error?  Can you share a screenshot of your flow and also one of the error?

     

    Damien

  • mvfsullivan Profile Picture
    8 on at

    Issue is resolved via the above post. I was just not adding the rest of my flow which left it unfinished. Noob mistake 😄

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard