Skip to content
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

[releases/25.x] [Email] Add subject to API and docs #1895

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading