2

在逻辑应用程序中使用带有附件的 http 触发器发送电子邮件。提供json输入如下

{
    "properties": {
        "bcc": {
            "type": "string"
        },
        "body": {
            "type": "string"
        },
        "cc": {
            "type": "string"
        },
        "subject": {
            "type": "string"
        },
        "to": {
            "type": "string"
        },
        "attachments":{
            "name":{
                "type":"string"
            },
            "ContentBytes":{
                "type":"string"
            }
        },
        "type":"object"
    },
    "type": "object"
}

以 base64 字符串格式传递附件。但是在为内容变量配置附件时出现错误

无法解析模板语言表达式 'base64('triggerBody()?['contentBytes']')':预期的标记 'RightParenthesis' 和实际的 'Identifier'。”。

在此处输入图像描述

4

1 回答 1

0

您需要单击Add dynamic content并使用以下表达式:

base64(triggerBody()?['attachments']?['ContentBytes'])

在此处输入图像描述

于 2021-06-01T01:26:07.693 回答