{"title":"Codeunit 8888 Email Dispatcher, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/8888-email-dispatcher/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":8888,"name":"Email Dispatcher","app":"System Application","url":"https://jonas-paprotka.de/ref/codeunit/8888-email-dispatcher/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/8888-email-dispatcher/source/","path":"src/System Application/App/Email/src/Email/EmailDispatcher.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:8703":{"name":"Feature Telemetry","url":"https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/"},"codeunit:8999":{"name":"Email Rate Limit Impl.","url":"https://jonas-paprotka.de/ref/codeunit/8999-email-rate-limit-impl/"},"codeunit:8905":{"name":"Email Message Impl.","url":"https://jonas-paprotka.de/ref/codeunit/8905-email-message-impl/"},"codeunit:8890":{"name":"Send Email","url":"https://jonas-paprotka.de/ref/codeunit/8890-send-email/"},"codeunit:8909":{"name":"Email Retry Impl.","url":"https://jonas-paprotka.de/ref/codeunit/8909-email-retry-impl/"},"table:8888":{"name":"Email Outbox","url":"https://jonas-paprotka.de/ref/table/8888-email-outbox/"},"codeunit:8901":{"name":"Email","url":"https://jonas-paprotka.de/ref/codeunit/8901-email/"},"table:8889":{"name":"Sent Email","url":"https://jonas-paprotka.de/ref/table/8889-sent-email/"},"table:8901":{"name":"Email Error","url":"https://jonas-paprotka.de/ref/table/8901-email-error/"}},"procs":[{"name":"OnRun","line":29,"kind":"trigger","steps":[[39,"ext","codeunit",8703,"LogUptake",4],[46,"ext","codeunit",8999,"IsRateLimitExceeded",4],[46,"ext","codeunit",8999,"IsConcurrencyLimitExceeded",3],[47,"call","RescheduleEmail",3],[49,"call","SendEmail",1]]},{"name":"SendEmail","line":52,"kind":"procedure","access":"local","params":1,"steps":[[66,"call","UpdateOutboxStatus",2],[68,"ext","codeunit",8905,"Get",1],[69,"call","LogAttachments",0],[71,"ext","codeunit",8890,"SetConnector",1],[72,"ext","codeunit",8890,"SetAccount",1],[74,"ext","codeunit",8905,"GetEmailMessage",1],[75,"run","codeunit",8890],[78,"ext","codeunit",8703,"LogUsage",4],[79,"call","InsertToSentEmail",2],[80,"ext","codeunit",8909,"CleanEmailRetry",1],[81,"write",8888,"Delete"],[82,"ext","codeunit",8905,"MarkAsRead",0],[85,"ext","codeunit",8703,"LogError",6],[87,"call","UpdateOutboxError",2],[88,"call","UpdateOutboxStatus",2],[92,"ext","codeunit",8909,"CreateEmailRetry",1],[94,"ext","codeunit",8909,"UpdateEmailRetryRecord",7],[97,"call","RetrySendEmail",1],[101,"ext","codeunit",8703,"LogError",6],[102,"call","UpdateOutboxError",2],[103,"call","UpdateOutboxStatus",2],[107,"ext","codeunit",8901,"OnAfterEmailSent",1],[109,"ext","codeunit",8901,"OnAfterEmailSendFailed",1]]},{"name":"RetrySendEmail","line":122,"kind":"procedure","access":"local","params":1,"steps":[[131,"ext","codeunit",8703,"LogUsage",4],[132,"validate",8888,"Retry No."],[134,"call","GetMaximumRetryCount",1],[135,"ext","codeunit",8703,"LogError",6],[140,"write",8888,"Modify"],[147,"ext","codeunit",8703,"LogUsage",4],[149,"validate",8888,"Task Scheduler Id"],[150,"validate",8888,"Date Sending"],[151,"write",8888,"Modify"],[153,"ext","codeunit",8909,"CreateEmailRetry",1]]},{"name":"RescheduleEmail","line":156,"kind":"procedure","access":"local","params":3,"steps":[[176,"write",8888,"Modify"],[179,"ext","codeunit",8703,"LogUsage",4]]},{"name":"InsertToSentEmail","line":183,"kind":"procedure","access":"local","params":2,"steps":[[189,"write",8889,"Insert"]]},{"name":"UpdateOutboxStatus","line":194,"kind":"procedure","access":"local","params":2,"steps":[[197,"write",8888,"Modify"]]},{"name":"UpdateOutboxError","line":201,"kind":"procedure","access":"local","params":2,"steps":[[211,"validate",8901,"Error Timestamp"],[212,"validate",8901,"Retry No."],[213,"write",8901,"Insert"],[217,"write",8888,"Modify"]]},{"name":"LogAttachments","line":220,"kind":"procedure","access":"local","params":0,"steps":[[222,"ext","codeunit",8905,"Attachments_First",0],[226,"ext","codeunit",8905,"Attachments_GetLength",0],[226,"ext","codeunit",8905,"Attachments_GetContentType",0],[226,"ext","codeunit",8905,"GetId",0],[227,"ext","codeunit",8905,"Attachments_Next",0]]}]}