Skip to content

Commit 18d5219

Browse files
joratzCopilot
andauthored
Add helper functions for creating activity with email response (#49)
* Add helper functions for creating activity with email response * Update libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py Co-authored-by: Copilot <[email protected]> * Update libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/email_response.py Co-authored-by: Copilot <[email protected]> * Remove AgentNotification helper * fix whitespace --------- Co-authored-by: Copilot <[email protected]>
1 parent 9a68182 commit 18d5219

File tree

1 file changed

+18
-0
lines changed
  • libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
from typing import Literal
2+
from microsoft_agents.activity.activity import Activity
23
from microsoft_agents.activity.entity import Entity
34

45

56
class EmailResponse(Entity):
67
type: Literal["emailResponse"] = "emailResponse"
78
html_body: str = ""
9+
10+
@staticmethod
11+
def create_email_response_activity(email_response_html_body: str) -> Activity:
12+
"""Create a new Activity with an EmailResponse entity.
13+
14+
Args:
15+
email_response_html_body: The HTML content for the email response.
16+
17+
Returns:
18+
A new Activity instance with type='message' and the EmailResponse entity attached.
19+
"""
20+
working_activity = Activity(type="message")
21+
email_response = EmailResponse(html_body=email_response_html_body)
22+
if working_activity.entities is None:
23+
working_activity.entities = []
24+
working_activity.entities.append(email_response)
25+
return working_activity

0 commit comments

Comments
 (0)