简体   繁体   中英

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?

在此处输入图片说明

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

See below

在此处输入图片说明

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

在此处输入图片说明

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": "abc@abc.com"
                    },
                    "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"
            }
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM