cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
david-atx
New Member

Send Email to Helpdesk address when a new conversation is created in a Teams Channel

I found it pretty simple to build a flow to send an email to my helpdesk email when a new conversation i started in a Teams Channel. However I'm having an issue getting the username to show up in the sent email. For this to work properly I need to know the user's email address that sent the mail. Does anyone know what code needs to be added to the flow to show user's email that posted the message?

 

 

Thanks in advance,

David

5 REPLIES 5
OliverR-82
Helper V
Helper V

Hi @david-atx ,

What trigger are you using? I would think that that information is provided by the trigger. Can you post a screenshot of your flow, perhaps?

OliverR-82
Helper V
Helper V

Ah, I see what you mean, just did a quick test myself. The user's email does not seem to be available in the dynamic content when you use the 'when a new channel message is added' action 😞

OliverR-82
Helper V
Helper V

Okay, there's an easy workaround to get to the user's email address, @david-atx .

If you insert the 'Get user provile (V2)' action and feed that the 'Message from user id' dynamic content, you will then be able to use the 'Mail' output from that 'Get user' action. That will give you the user's email address.

OliverR-82_0-1615475590840.png

 

I'm getting closer to the desired result! At least I can see who is sending the message now... Any ideas on how I can get it to show the person who posted the message as the from address?

 

 

Screen Shot 2021-03-11 at 8.37.43 PM.png

 

Screen Shot 2021-03-11 at 8.38.13 PM.png

Hi @david-atx ,

I had a feeling that that was going to be your next question.

If you use the 'Send an email notification' then that mail is always going to come from Microsoft Power Apps, as your screenshot shows. You're usually better off using the 'Send an email (V2)' action; that uses an O365 account. That action does allow you to insert a value in the 'From' field.

But... there's a very important caveat here: this uses the 'send as' method. This means that doing so requires the person that triggers the flow (ie. the one who posts the message in the Teams channel) to have 'send as' permissions on the mailbox of the account that the flow is running under. In practice you usually don't want to do that, especially if there are a lot of users who can potentially trigger the flow, as they would all have to have permissions on that mailbox.

So... long story short: there's no easy way to have a mail sent from the user that triggers your flow in this scenario as far as I know. It's a question that a lot of people ask.

An alternative could be to use the 'Send an email from a shared mailbox (V2)' action. That way mails still aren't sent from the account of the user who triggered the flow, but at least they aren't from your own account either. Instead they're sent from a shared mailbox.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,677)