cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kyasprin
Regular Visitor

Send an Email (V2) Without Granting Access to the owner/creators outlook account

Our Department is working on a Power App for our Organization that allows members of our group to fill out a powerapp form and send an email to our Tier I Desktop Support with the information in an organized way each time. The email from field is pulled from the logged in user in power apps via User().Email and passed via variable to Power Automate Send an Email (V2). The email sends to our Tier I Desktop Support Entity which generates an automated response via their ticketing software back whomever sent in the email request (in this case the User().Email signed in and using the PowerApp) - Our group needs this ticket to communicate with them and tag items for them to come pickup.

 

This works great as long as the user of the power app is the creator of the Power Automate flow, or has access to send email on behalf of the Power Automate flow creator. When the User().Email signed in to the Power app is not the power automate flow creator or does not have access to send email on behalf of the flow creator, this solution breaks and the email does not send.

 

From what I've seen, it seems that everyone in our group needs to be setup with send as access for all other employees who might possibly be the creator of a Power Automate Flow w/ Send an Email (V2) in a PowerApp they have access to - a laughably poor functionatliy from an enterprise standpoint. Management time to set up send as for every user who might user your flow, and considerations for why this is a bad idea for security reasons, seem to render Send an Email (V2) as mostly useless beyond your own personal PowerApp/Power Automate Flow needs.

 

Is there not a better thought out Enterprise solution through PowerApps/Power Automate? How would we create this PowerApp and Power Automate Flow so that we can handle such a simple task of sending an email from the person filling out the PowerApp form without granting send as access to the flow creator's mailbox for dozens, hundreds, or thousands of other users?

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Super User
Super User

Is it an option for you to use the Office365Outlook.SendEmail() function in Power Apps if all you need to do is send an email? After the Power App is shared with a user and the user also needs consent to the Office 365 Outlook connector. This connector is not part of the Power App, this connector is from the flow that will end the email.  Because the flows is being called from the Power App, all the connections in the flow will also run under the context of the user running the Power Apps. (For more info, see Run Power Apps connections with elevated permissions via Power Automate | Impersonate flow actions).

 

Snag_230ac88.png

Snag_230ef0f.png

 

I did some limited testing using both Office365Outlook.SendEmail() function in Power Apps and by calling a flow using Power Automate Sendmail action. The flow appears to work even though the Send an email action was initially setup using my connection details:

Snag_25fdb44.png

Flows triggered from Power Apps run in the content of the user running the App.

 

Anyway, here are the test results:

 

App Run by Adele:

Snag_248ec99.png

AlexW's inbox:

Snag_2494112.png

 

App Run by AlexW:

Snag_24a94cb.png

 

AlexW's inbox:

Snag_24b550e.png

 

App Run by me (creator of the app and flow):

Snag_24cfa13.png

AlexW's inbox:

Snag_24e9e8c.png

 

So flows triggered from Power Apps run in the content of the user running the App.

 

Ellis

View solution in original post

1 REPLY 1
ekarim2020
Super User
Super User

Is it an option for you to use the Office365Outlook.SendEmail() function in Power Apps if all you need to do is send an email? After the Power App is shared with a user and the user also needs consent to the Office 365 Outlook connector. This connector is not part of the Power App, this connector is from the flow that will end the email.  Because the flows is being called from the Power App, all the connections in the flow will also run under the context of the user running the Power Apps. (For more info, see Run Power Apps connections with elevated permissions via Power Automate | Impersonate flow actions).

 

Snag_230ac88.png

Snag_230ef0f.png

 

I did some limited testing using both Office365Outlook.SendEmail() function in Power Apps and by calling a flow using Power Automate Sendmail action. The flow appears to work even though the Send an email action was initially setup using my connection details:

Snag_25fdb44.png

Flows triggered from Power Apps run in the content of the user running the App.

 

Anyway, here are the test results:

 

App Run by Adele:

Snag_248ec99.png

AlexW's inbox:

Snag_2494112.png

 

App Run by AlexW:

Snag_24a94cb.png

 

AlexW's inbox:

Snag_24b550e.png

 

App Run by me (creator of the app and flow):

Snag_24cfa13.png

AlexW's inbox:

Snag_24e9e8c.png

 

So flows triggered from Power Apps run in the content of the user running the App.

 

Ellis

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,785)