I want to trigger a Flow from Power Apps on select of a button that sends emails. Regardless of the user who performed the on select action, I want to send the email from a shared account using the Send an email (V2) action.
The flow is owned by a service account. The shared account is in the From (Send as) line. When I test within the Flow, it works fine. When I test within Power Apps as a user who is not the service account, the Flow fails (You are not authorized to send mail on behalf of the specified sending account).
The connection for Send an email is using the service account Office 365 Outlook connection. I thought that as long as the connection performing the Send Email action has Send as/send on behalf of permission, the email could send from the shared account. I do not want to give all users using the app send on behalf of permission from the shared account, only for app purposes. Am I wrong on how these permissions work?
EDIT: it seems that the main issue is the fact that the flow is triggered from Power Apps. I can use send on behalf of as expected when the flow is triggered from something like When an item is added to a list, regardless of who performs the action of adding the item. The update of sending from this shared account is new request and there are about 30 places in my app where emails are sent on a button click so I don't really want to change the trigger at this point. Does anyone know if it's possible to force the send action to be run by the owner of the Flow so send on behalf of works rather than the person performing the action?