Hi @SashaM,
Welcome to the Microsoft Q&A Platform!
Thank you for reaching out regarding your question on Azure Logic Apps and the "Send an email (V2)" action in Office 365. Below is a solution on how to compare the email address provided in the HTTP request body with the actual "To" recipient address before sending the email.
- Trigger: When an HTTP request is received
Configure this trigger to accept parameters in the request body, includingmanagerEmail
{ "properties": { "managerEmail": { "type": "string" } } }
- Initialize Variable: Add an Initialize Variable action to store the
managerEmail
value from the HTTP request body.**Name**: `managerEmail` **Type**: `String` **Value**: `@triggerBody()?['managerEmail']` ```1. **Condition to Verify Recipient**:
Add a Condition action to verify if managerEmail
from the request body matches the intended manager’s email.
equals(variables('managerEmail'), 'manager@example.com')
If True Path (Emails Match):
In the If True branch, add the Send an Email (V2) action to send the email to the verified recipient.
From: Sender email
To: Manager email (verified)
Subject: Custom subject as needed
Body: Custom body as needed
If False Path (Emails Do Not Match):
In the If False branch, handle the case where the emails do not match. This may involve
Overall, the Designer looks like the image below:
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.