-
Notifications
You must be signed in to change notification settings - Fork 459
[SOA] Show Cc recipients on email messages #10247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
135457c
dfeadde
c9f82cb
2ab95e4
34567c6
e0b5a62
6c01710
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,10 +7,12 @@ namespace Microsoft.Agent.SalesOrderAgent; | |||||||||||||||
|
|
||||||||||||||||
| using Microsoft.CRM.Contact; | ||||||||||||||||
| using System.Agents; | ||||||||||||||||
| using System.Email; | ||||||||||||||||
|
|
||||||||||||||||
| codeunit 4398 "SOA Task Message" | ||||||||||||||||
| { | ||||||||||||||||
| Access = Internal; | ||||||||||||||||
| Permissions = tabledata "Email Inbox" = r; | ||||||||||||||||
| InherentEntitlements = X; | ||||||||||||||||
| InherentPermissions = X; | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -121,6 +123,56 @@ codeunit 4398 "SOA Task Message" | |||||||||||||||
| exit(true); | ||||||||||||||||
| end; | ||||||||||||||||
|
|
||||||||||||||||
| internal procedure GetMessageCcRecipients(AgentTaskMessage: Record "Agent Task Message"): Text | ||||||||||||||||
|
attilatoury marked this conversation as resolved.
attilatoury marked this conversation as resolved.
|
||||||||||||||||
| var | ||||||||||||||||
| SourceAgentTaskMessage: Record "Agent Task Message"; | ||||||||||||||||
| SOAEmail: Record "SOA Email"; | ||||||||||||||||
| EmailInbox: Record "Email Inbox"; | ||||||||||||||||
| EmailMessage: Codeunit "Email Message"; | ||||||||||||||||
| SOASendReply: Codeunit "SOA Send Reply"; | ||||||||||||||||
| CcRecipients: List of [Text]; | ||||||||||||||||
| IsMappedReply: Boolean; | ||||||||||||||||
| begin | ||||||||||||||||
| SourceAgentTaskMessage := AgentTaskMessage; | ||||||||||||||||
| if AgentTaskMessage.Type = AgentTaskMessage.Type::Output then begin | ||||||||||||||||
| if not SourceAgentTaskMessage.Get(AgentTaskMessage."Task ID", AgentTaskMessage."Input Message ID") then | ||||||||||||||||
| exit(''); | ||||||||||||||||
|
Comment on lines
+137
to
+139
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Knowledge: 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
||||||||||||||||
| if not SOASendReply.TryGetMappedReplyCcRecipients(SourceAgentTaskMessage, CcRecipients, IsMappedReply) then | ||||||||||||||||
| exit(''); | ||||||||||||||||
| if IsMappedReply then | ||||||||||||||||
| exit(RecipientsToText(CcRecipients)); | ||||||||||||||||
| end; | ||||||||||||||||
|
|
||||||||||||||||
| SOAEmail.SetLoadFields("Email Inbox ID"); | ||||||||||||||||
| SOAEmail.SetRange("Task ID", SourceAgentTaskMessage."Task ID"); | ||||||||||||||||
|
attilatoury marked this conversation as resolved.
|
||||||||||||||||
| SOAEmail.SetRange("Task Message ID", SourceAgentTaskMessage.ID); | ||||||||||||||||
| if not SOAEmail.FindFirst() then | ||||||||||||||||
| exit(''); | ||||||||||||||||
|
attilatoury marked this conversation as resolved.
|
||||||||||||||||
|
|
||||||||||||||||
| EmailInbox.SetLoadFields("Message Id"); | ||||||||||||||||
| if not EmailInbox.Get(SOAEmail."Email Inbox ID") then | ||||||||||||||||
| exit(''); | ||||||||||||||||
| if not EmailMessage.Get(EmailInbox."Message Id") then | ||||||||||||||||
| exit(''); | ||||||||||||||||
|
|
||||||||||||||||
| EmailMessage.GetRecipients(Enum::"Email Recipient Type"::Cc, CcRecipients); | ||||||||||||||||
| exit(RecipientsToText(CcRecipients)); | ||||||||||||||||
| end; | ||||||||||||||||
|
|
||||||||||||||||
| local procedure RecipientsToText(Recipients: List of [Text]): Text | ||||||||||||||||
| var | ||||||||||||||||
| Recipient: Text; | ||||||||||||||||
| RecipientsTextBuilder: TextBuilder; | ||||||||||||||||
| begin | ||||||||||||||||
| foreach Recipient in Recipients do begin | ||||||||||||||||
| if RecipientsTextBuilder.Length() > 0 then | ||||||||||||||||
| RecipientsTextBuilder.Append(';'); | ||||||||||||||||
| RecipientsTextBuilder.Append(Recipient); | ||||||||||||||||
| end; | ||||||||||||||||
|
|
||||||||||||||||
| exit(RecipientsTextBuilder.ToText()); | ||||||||||||||||
| end; | ||||||||||||||||
|
|
||||||||||||||||
| internal procedure MessageRequiresReview(SOASetup: Record "SOA Setup"; SenderAddress: Text; IsFirstMessageInTask: Boolean): Boolean | ||||||||||||||||
| var | ||||||||||||||||
| SOAFiltersImpl: Codeunit "SOA Filters Impl."; | ||||||||||||||||
|
|
||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.