Flow to send mails from emails in JSON

IberianLynx 0 Reputation points
2023-03-12T11:31:47.8833333+00:00

Hello,

I'm trying to make a flow with the trigger "When a HTTP request is received".

In this case, when a web form is filling, a JSON is provide.

{

   "to": "******@email.es, ******@email.es, ******@email.es",

   "body": "<h1>Hello</h1>",

   "subject": "Registration of an event"

}

the number of emails as well as ther names may change.

What I want is that, when the web data is filled and that JSON is received, the flow sends to all the emails found in JSON an email with the subjet and the body found in JSON.

It's my first flow, so I would aprreciate if you help me be very clear.

Thank you very much

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,558 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,941 Reputation points Moderator
    2023-03-13T07:11:32.4633333+00:00

    @IberianLynx Thanks for reaching out. Assuming that you want to send single email to individual emails rather than sending one email to all the email ID's and the json object is defined as below

    {
       "to": "******@email.es, ******@email.es, ******@email.es",
       "body": "<h1>Hello</h1>",
       "subject": "Registration of an event"
    }
    
    

    Workflow:

    User's image

    You can change the above workflow and add individual names as per your input and customize it as per your need. You can refer to this document to know more about outlook connector. In case if you only need to send one email to all the email ID's then you need to remove the for each statement and use replace in the emaiList.

    You can refer to function reference for more details on the available functions in logic app.

    For your reference sharing the Code View with array and Code View without array

    The above is only for reference and you can modify it as per your requirement. Feel free to get back to me if you need any assistance.

    Please accept as "Yes" if the answer is helpful so that it can help others in the community. If you need any help/clarification/concerns/follow up questions, then please click on "Add Comment" on my answer and provide more details.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.