Hello,
Is there a way to use the email functionality in AL when using an AzureAD Registered app? Our app makes a bunch of POST requests to populate Business Central tables, and after doing this we want it to send an email with the results.
If I add an action to a page in BC and use the UI to trigger the codeunit, the email gets sent, but when our app is calling the codeunit nothing happens.
procedure AlertNotify(header: Text[50]; message: Text[200])
var
TxtRecipientList: List of [Text];
EmailObj: Codeunit "Email";
EmailMsg: Codeunit "Email Message";
begin
TxtRecipientList.Add('info@ourcompany.com');
EmailMsg.Create(
TxtRecipientList,
header,
message,
false
);
EmailObj.Send(EmailMsg, Enum::"Email Scenario"::"Notification");
end;
Our AzureAD app has D365 Automation permissions, and we're telling it to use the shared mailbox email account that has had the Notification scenario applied.
Anyone got any ideas as to what's happening?