Nov 29 2022 05:21 AM
The message to be rewritten does not contain an actionable message. Is it possible to insert an existing actionable message in an existing email message?
When I update the message with the API, the body of the message is modified but the actionable message does not appear.
I have the impression that Outlook checks the presence and interprets the actionable message when it receives the email. But when I edit an existing message, it will not check the existence of an actionable message.
I tested the following cases:
The debugger's diagnostics show me this :
{"CardEnabledForMessage": false,
"ClientName": "OutlookWebApp",
"ClientVersion": "20221111004.15",
"InternetMessageId": "<email address removed for privacy reasons>",
"EntityExtractionSuccess": true,
-"AdaptiveCardPayload": {
"found": true,
"type": "AdaptiveCard"
},
-"MessageCardPayload": {
"found": false,
"type": null
},
-"AuthHeader": {
"results": "dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fakedomain.onmicrosoft.com;",
"authAs": "Internal"
}
}
Code for path message :
def update_message(
self, data: DataEvent, office_message_body: OfficeMessageBody
) -> int:
"""
https://learn.microsoft.com/en-us/graph/api/message-update?view=graph-rest-1.0&tabs=http#http-request
"""
url = f"/users/{data.id_user}/messages/{data.id_message}"
response = self.microsoft_api.patch(
url=url,
json={"body": office_message_body.dict()},
headers={
"CARD-UPDATE-IN-BODY": "true",
},
)
return response.status_code
Content of body :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="application/adaptivecard+json">{
"type": "AdaptiveCard",
"version": "1.0",
"originator": "DONT_DISPLAY_IN_STACKOVERFLOW",
"body": [
{
"type": "TextBlock",
"text": "Visit the Outlook Portal",
"size": "large"
},
{
"type": "TextBlock",
"text": "Click **Learn More** to learn more about Actionable Messages!"
},
{
"type": "Input.Text",
"id": "feedbackText",
"placeholder": "Let us know what you think about Actionable Messages"
}
]
}
</script>
</head>
<body>
test Modify message
</body>
</html>
Thank you :)