Logic Apps-使用json从http请求正文获取电子邮件信息

时间:2018-08-19 19:24:48

标签: json azure http outlook azure-logic-apps

如何确定请求正文中的电子邮件数据并将其集成到Outlook功能中?

enter image description here

1 个答案:

答案 0 :(得分:2)

您可以使用Outlook将来自Http请求的整个响应Body轻松发送到电子邮件的正文中。

见下文

enter image description here

从HTTP请求中选择正文并将其传递给电子邮件正文(作为原始JSON)

enter image description here

相应的代码如下

{
    "$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"
            }
        }
    }
}