Hi everyone,
I'm working on a Power Automate flow to handle undelivered mail notifications. My goal is to extract the email ID to which I tried to send an email but was not delivered.
In the flow, I'm currently using the following expression to extract the recipient's email ID:
@triggerOutputs()?['body']['toRecipients']
However, this expression is not working as expected for all domains. For example, when I receive an undelivered mail notification from the postmaster, the expression returns my own email ID instead of the incorrect one.
Below is a sample of the undelivered mail notification I received:

Could someone please help me with the correct approach to extract the recipient's email ID from such notifications?
Thank you in advance for your assistance!