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
Advocate II
Advocate II

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
Advocate II
Advocate II

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
Advocate II
Advocate II

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (45,260)