We did this for a customer in NAV & then carried it in Business Central, you can try below by creating a codeunit, hope this helps,
Codeunit 50000 "Send Job Queue Staus Email"
{
TableNo = "Job Queue Entry";
trigger OnRun()
begin
case Rec.Status of
Rec.Status::Error:
begin
Clear(EmailMessage);
Clear(Email);
ToRecipients := 'xyz@abcmail.com';
EmailSubject := 'Error in Job Queue - ' + format(Rec."Object ID to Run");
EmailBody := GetErrorDescp(Rec.ID);
EmailMessage.Create(ToRecipients, EmailSubject, EmailBody, true, CCRecipients, BCCRecipients);
Email.send(EmailMessage);
end;
end;
end;
var
EmailSubject: Text;
EmailBody: Text;
EmailMessage: Codeunit "Email Message";
CCRecipients: List of [Text];
ToRecipients: List of [Text];
BCCRecipients: List of [Text];
Email: Codeunit Email;
local procedure GetErrorDescp(JobId: Code[250]): Text
var
JobQueueLogEntry: Record "Job Queue Log Entry";
begin
JobQueueLogEntry.Reset;
JobQueueLogEntry.SetRange(JobQueueLogEntry.ID, JobId);
if JobQueueLogEntry.FindLast then
exit(JobQueueLogEntry."Error Message");
end;
}