Skip to content

Commit

Permalink
Reapply "[Email] Add subject to API and docs (#1894)" (#1919) (#2031)
Browse files Browse the repository at this point in the history
  • Loading branch information
mazhelez authored Sep 13, 2024
1 parent c7f15ce commit 510712b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build/Packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Source": "NuGet.org"
},
"AppBaselines-BCArtifacts": {
"Version": "25.1.23628.0",
"Version": "25.1.24147.0",
"Source": "BCArtifacts",
"_comment": "Used to fetch app baselines from BC artifacts"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,57 @@ codeunit 8904 "Email Message"
EmailMessageImpl.Create(ToRecipients, Subject, Body, HtmlFormatted, CCRecipients, BCCRecipients);
end;

procedure CreateReply(ToRecipients: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
/// <summary>
/// Creates the email reply with recipients, subject, and body.
/// </summary>
/// <param name="ToRecipients">The recipient(s) of the email. A string containing the email addresses of the recipients separated by semicolon.</param>
/// <param name="Subject">The subject of the email.</param>
/// <param name="Body">The body of the email.</param>
/// <param name="HtmlFormatted">Whether the body is HTML formatted.</param>
/// <param name="ExternalId">The external message id to reply to.</param>
procedure CreateReply(ToRecipients: Text; Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
begin
EmailMessageImpl.CreateReply(ToRecipients, Body, HtmlFormatted, ExternalId);
EmailMessageImpl.CreateReply(ToRecipients, Subject, Body, HtmlFormatted, ExternalId);
end;

procedure CreateReply(ToRecipients: List of [Text]; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
/// <summary>
/// Creates the email reply with recipients, subject, and body.
/// </summary>
/// <param name="ToRecipients">The recipient(s) of the email. A list of email addresses the email will be send directly to.</param>
/// <param name="Subject">The subject of the email.</param>
/// <param name="Body">The body of the email.</param>
/// <param name="HtmlFormatted">Whether the body is HTML formatted.</param>
/// <param name="ExternalId">The external message id to reply to.</param>
procedure CreateReply(ToRecipients: List of [Text]; Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
begin
EmailMessageImpl.CreateReply(ToRecipients, Body, HtmlFormatted, ExternalId);
EmailMessageImpl.CreateReply(ToRecipients, Subject, Body, HtmlFormatted, ExternalId);
end;

procedure CreateReply(ToRecipients: List of [Text]; Body: Text; HtmlFormatted: Boolean; ExternalId: Text; CCRecipients: List of [Text]; BCCRecipients: List of [Text])
/// <summary>
/// Creates the email reply with recipients, subject, and body.
/// </summary>
/// <param name="ToRecipients">The recipient(s) of the email. A list of email addresses the email will be send directly to.</param>
/// <param name="Subject">The subject of the email.</param>
/// <param name="Body">The body of the email.</param>
/// <param name="HtmlFormatted">Whether the body is HTML formatted.</param>
/// <param name="ExternalId">The external message id to reply to.</param>
/// <param name="CCRecipients">The CC recipient(s) of the email. A list of email addresses that will be listed as CC.</param>
/// <param name="BCCRecipients">TThe BCC recipient(s) of the email. A list of email addresses that will be listed as BCC.</param>
procedure CreateReply(ToRecipients: List of [Text]; Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text; CCRecipients: List of [Text]; BCCRecipients: List of [Text])
begin
EmailMessageImpl.CreateReply(ToRecipients, Body, HtmlFormatted, ExternalId, CCRecipients, BCCRecipients);
EmailMessageImpl.CreateReply(ToRecipients, Subject, Body, HtmlFormatted, ExternalId, CCRecipients, BCCRecipients);
end;

procedure CreateReplyAll(Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
/// <summary>
/// Creates the email replying to all existing recipents on the mail thread, subject, and body.
/// </summary>
/// <param name="Subject">The subject of the email.</param>
/// <param name="Body">The body of the email.</param>
/// <param name="HtmlFormatted">Whether the body is HTML formatted.</param>
/// <param name="ExternalId">The external message id to reply to.</param>
procedure CreateReplyAll(Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
begin
EmailMessageImpl.CreateReplyAll(Body, HtmlFormatted, ExternalId);
EmailMessageImpl.CreateReplyAll(Subject, Body, HtmlFormatted, ExternalId);
end;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,32 @@ codeunit 8905 "Email Message Impl."
UpdateMessage(Recipients, Subject, Body, HtmlFormatted, '', CCRecipients, BCCRecipients);
end;

procedure CreateReply(ToRecipients: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
procedure CreateReply(ToRecipients: Text; Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
var
EmptyList: List of [Text];
begin
CreateReply(EmptyList, Body, HtmlFormatted, ExternalId, EmptyList, EmptyList);
CreateReply(EmptyList, Subject, Body, HtmlFormatted, ExternalId, EmptyList, EmptyList);
SetRecipients(Enum::"Email Recipient Type"::"To", ToRecipients);
end;

procedure CreateReply(ToRecipients: List of [Text]; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
procedure CreateReply(ToRecipients: List of [Text]; Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
var
EmptyList: List of [Text];
begin
CreateReply(ToRecipients, Body, HtmlFormatted, ExternalId, EmptyList, EmptyList);
CreateReply(ToRecipients, Subject, Body, HtmlFormatted, ExternalId, EmptyList, EmptyList);
end;

procedure CreateReplyAll(Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
procedure CreateReplyAll(Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text)
var
EmptyList: List of [Text];
begin
CreateReply(EmptyList, Body, HtmlFormatted, ExternalId, EmptyList, EmptyList);
CreateReply(EmptyList, Subject, Body, HtmlFormatted, ExternalId, EmptyList, EmptyList);
end;

procedure CreateReply(ToRecipients: List of [Text]; Body: Text; HtmlFormatted: Boolean; ExternalId: Text; CCRecipients: List of [Text]; BCCRecipients: List of [Text])
procedure CreateReply(ToRecipients: List of [Text]; Subject: Text; Body: Text; HtmlFormatted: Boolean; ExternalId: Text; CCRecipients: List of [Text]; BCCRecipients: List of [Text])
begin
InitializeCreation();
UpdateMessage(ToRecipients, '', Body, HtmlFormatted, ExternalId, CCRecipients, BCCRecipients);
UpdateMessage(ToRecipients, Subject, Body, HtmlFormatted, ExternalId, CCRecipients, BCCRecipients);
end;

local procedure InitializeCreation()
Expand Down
6 changes: 3 additions & 3 deletions src/System Application/Test/Email/src/EmailTest.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -1782,21 +1782,21 @@ codeunit 134685 "Email Test"
var
Any: Codeunit Any;
begin
EmailMessage.CreateReply(Any.Email(), Any.UnicodeText(50), true, Any.UnicodeText(250));
EmailMessage.CreateReply(Any.Email(), Any.UnicodeText(250), Any.UnicodeText(50), true, Any.UnicodeText(250));
end;

local procedure CreateEmailReply(var EmailMessage: Codeunit "Email Message"; Recipients: Text)
var
Any: Codeunit Any;
begin
EmailMessage.CreateReply(Recipients, Any.UnicodeText(50), true, Any.UnicodeText(250));
EmailMessage.CreateReply(Recipients, Any.UnicodeText(250), Any.UnicodeText(50), true, Any.UnicodeText(250));
end;

local procedure CreateEmailReplyAll(var EmailMessage: Codeunit "Email Message")
var
Any: Codeunit Any;
begin
EmailMessage.CreateReplyAll(Any.UnicodeText(50), true, Any.UnicodeText(250));
EmailMessage.CreateReplyAll(Any.UnicodeText(250), Any.UnicodeText(50), true, Any.UnicodeText(250));
end;

[StrMenuHandler]
Expand Down

0 comments on commit 510712b

Please sign in to comment.