桌面上Outlook 365中具有HTML正文的Adaptive Card垂直滚动条

时间:2018-11-13 15:30:29

标签: html outlook adaptive-cards

我在C#使用SMTP客户端发送的html页的head标签内的script标签中有一个有效载荷。它工作正常,我在桌面上的Outlook 365中看到该卡,但问题是该卡的高度是根据内容预定义的,因此当人们的屏幕较小时,该卡会有一个垂直滚动条。此外,页面正文中的html也具有垂直滚动条。我尝试使用Outlook.com,但没有出现这种情况

这些滚动条是不可取的。确保卡和html都没有垂直滚动条并让Outlook拥有垂直滚动条的正确方法是什么,以便我们可以使用Outlook滚动条滚动而不是卡或HTML

enter image description here

这是有效载荷:

<div>
    <script type="application/adaptivecard+json">
    {
        "type": "AdaptiveCard",
        "body": [
            {
                "type": "Container",
                "items": [
                    {
                        "type": "Image",
                        "url": "@LOGO",
                        "size": "Large"
                    },
                    {
                        "type": "TextBlock",
                        "size": "Medium",
                        "weight": "Bolder",
                        "text": "@ADAPTIVE_CARD_TITLE"
                    },
                    {
                        "type": "ColumnSet",
                        "columns": [
                            {
                                "type": "Column",
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "weight": "Bolder",
                                        "text": "@SERVICE_TITLE",
                                        "wrap": true
                                    },
                                    {
                                        "type": "TextBlock",
                                        "spacing": "None",
                                        "text": "@SERVICE_DATE",
                                        "isSubtle": true,
                                        "wrap": true
                                    }
                                ],
                                "width": "stretch"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "Container",
                "items": [
                    {
                        "type": "TextBlock",
                        "spacing": "None",
                        "text": "@REVIEW_TITLE",
                        "wrap": true
                    },
                    {
                        "type": "ColumnSet",
                        "separator": true,
                        "columns": [
                            {
                                "type": "Column",
                                "separator": true,
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "text": "@EMPLOYEE_TITLE"
                                    }
                                ],
                                "width": "stretch"
                            },
                            {
                                "type": "Column",
                                "separator": true,
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "text": "@EMPLOYEE_VALUE"
                                    }
                                ],
                                "width": "stretch"
                            }
                        ]
                    },
                    {
                        "type": "ColumnSet",
                        "spacing": "None",
                        "separator": true,
                        "columns": [
                            {
                                "type": "Column",
                                "separator": true,
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "text": "@ACCOUNT_DATE_TITLE"
                                    }
                                ],
                                "width": "stretch"
                            },
                            {
                                "type": "Column",
                                "separator": true,
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "text": "@ACCOUNT_DATE_VALUE"
                                    }
                                ],
                                "width": "stretch"
                            }
                        ]
                    }
                ]
            }
        ],
        "actions": [
            {
                "type": "Action.OpenUrl",
                "title": "@APPROVE_TITLE",
                "url": "@APPROVE_URL"
            },
            {
                "type": "Action.ShowCard",
                "title": "@REJECT_TITLE",
                "card": {
                    "type": "AdaptiveCard",
                    "body": [
                        {
                            "type": "Input.Text",
                            "id": "comment",
                            "placeholder": "@COMMENT_PLACE_HOLDER",
                            "isMultiline": true
                        }
                    ],
                    "actions": [
                        {
                            "type": "Action.OpenUrl",
                            "title": "@SEND_REASON_TITLE",
                            "url": "@SEND_REASON_URL"
                        }
                    ],
                    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
                }
            }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.0"
    }
    </script>
    <br />
    @BODY
</div>

1 个答案:

答案 0 :(得分:1)

我会发表评论,但我没有代表。

我无法复制您的问题。我用在设计器中制作的一张长卡片进行了测试(只是添加了许多文本块),并在OWA(Outlook Web App)中进行了查看,并且只有一个滚动条。我不在台式机客户端的月度发布渠道上,因此我无法对其进行测试(仅与月度发布渠道兼容。

哪个版本的Outlook正在渲染卡?

也许尝试将@BODY放在脚本标签下方的头部内?它可能会删除其中一个滚动条。