Skip to content

Commit 03c4e7c

Browse files
gggdtttwenjiefan
andauthored
[26.3] Disable email retry (#4035)
<!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#582424](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/582424) Co-authored-by: wenjiefan <[email protected]>
1 parent 3677c61 commit 03c4e7c

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/System Application/App/Email/src/Email/EmailDispatcher.Codeunit.al

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ codeunit 8888 "Email Dispatcher"
113113

114114
procedure GetMaximumRetryCount(): Integer
115115
begin
116-
exit(10); // Maximum retry count for sending emails
116+
exit(0); // Maximum retry count for sending emails
117117
end;
118118

119119
local procedure RetrySendEmail(var EmailOutbox: Record "Email Outbox"): Boolean

src/System Application/Test/Email/src/EmailRetryTest.Codeunit.al

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ codeunit 134703 "Email Retry Test"
254254
TestClientTypeSubscriber: Codeunit "Test Client Type Subscriber";
255255
EmailOutboxPage: Page "Email Outbox";
256256
EmailOutboxTestPage: TestPage "Email Outbox";
257-
ScheduledDateTime: DateTime;
258257
begin
259258
// [Scenario] When sending an email on the background and then fails, the email should be scheduled for retry
260259
// [Given] An email message and an email account are created
@@ -277,7 +276,6 @@ codeunit 134703 "Email Retry Test"
277276
EmailOutbox.SetRange("Message Id", EmailMessage.GetId());
278277
EmailOutbox.FindFirst();
279278
Codeunit.Run(Codeunit::"Email Dispatcher", EmailOutbox);
280-
ScheduledDateTime := CurrentDateTime();
281279

282280
// [THEN] The email outbox entry is updated with the error message and status
283281
EmailRetry.SetRange("Account Id", TempAccount."Account Id");
@@ -287,12 +285,7 @@ codeunit 134703 "Email Retry Test"
287285
Assert.AreEqual(Enum::"Email Status"::Failed.AsInteger(), EmailRetry.Status.AsInteger(), 'Wrong status');
288286
Assert.AreEqual('Failed to send email', EmailRetry."Error Message", 'Wrong error message');
289287
Assert.AreEqual(1, EmailRetry."Retry No.", 'The retry number should be 1');
290-
Assert.AreEqual(2, EmailRetry.Count(), 'There are two entries in the Email Retry table');
291-
292-
EmailRetry.Next();
293-
Assert.AreEqual(Enum::"Email Status"::Queued.AsInteger(), EmailRetry.Status.AsInteger(), 'Wrong status');
294-
Assert.AreEqual(2, EmailRetry."Retry No.", 'The retry number should be 2');
295-
Assert.IsTrue(EmailRetry."Date Sending" > ScheduledDateTime, 'The Date Queued should be later than now');
288+
Assert.AreEqual(1, EmailRetry.Count(), 'There are two entries in the Email Retry table');
296289

297290
// [When] The Email Outbox page is opened and the retry detail is shown
298291
EmailOutboxTestPage.Trap();
@@ -622,12 +615,6 @@ codeunit 134703 "Email Retry Test"
622615
Assert.IsTrue(EmailRetryDetailPage.ShowError.Enabled(), 'The Show Error action should be enabled');
623616
Assert.IsTrue(EmailRetryDetailPage.ShowErrorCallStack.Enabled(), 'The Show Error Call Stack action should be enabled');
624617

625-
Assert.IsTrue(EmailRetryDetailPage.Next(), 'The second Email Retry Detail should be shown');
626-
Assert.AreEqual(Enum::"Email Status"::Queued.AsInteger(), EmailRetryDetailPage.Status.AsInteger(), 'Wrong status');
627-
Assert.AreEqual(2, EmailRetryDetailPage."Retry No.".AsInteger(), 'The retry number should be 2');
628-
Assert.IsFalse(EmailRetryDetailPage.ShowError.Enabled(), 'The Show Error action should be disabled');
629-
Assert.IsFalse(EmailRetryDetailPage.ShowErrorCallStack.Enabled(), 'The Show Error Call Stack action should be disabled');
630-
631618
Assert.IsFalse(EmailRetryDetailPage.Next(), 'There should be no more Email Retry Details');
632619
end;
633620
}

0 commit comments

Comments
 (0)