peter455
peter455

Reputation: 13

Logic Apps - Get Email Infos from http request body with json

How can you determine the email data from a request body and integrate it into the Outlook function?

enter image description here

Upvotes: 1

Views: 1347

Answers (1)

Jayendran
Jayendran

Reputation: 10920

You can easily send the whole Body of the response from the Http request into the Body of the Email using outlook.

See below

enter image description here

Select the body from the HTTP request and pass it to the email body (as a raw JSON)

enter image description here

The corresponding code will look like

{
    "$connections": {
        "value": {
            "office365": {
                "connectionId": "/subscriptions/....../Microsoft.Web/connections/office365",
                "connectionName": "office365",
                "id": "/subscriptions/......./Microsoft.Web/locations/southindia/managedApis/office365"
            }
        }
    },
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Send_an_email": {
                "inputs": {
                    "body": {
                        "Body": "@{triggerBody()}",
                        "Subject": "test",
                        "To": "[email protected]"
                    },
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['office365']['connectionId']"
                        }
                    },
                    "method": "post",
                    "path": "/Mail"
                },
                "runAfter": {},
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "manual": {
                "inputs": {
                    "method": "POST",
                    "schema": {}
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    }
}

Upvotes: 2

Related Questions