Escalation E-mail / Template Sending Merged Documents

Good day, all.

We have a requirement to have a document of a specific type that was merged / uploaded against a custom entity, to be sent to the linked customer record using an escalation e-mail.

We have previously developed an application that can do this, but our app only catered for normal SMTP and doesn't cater for Oauth2.0 and this customer is using Microsoft 365. So instead of having to update our app to also cater for Oauth2.0, I was wondering if anyone has ever been able to do something like this? It's almost like the functionality when sending a CRM quote to the customer where CRM automatically attach the newly generated quote document into the mail, with the exceptions that this is not for the quotes entity but a custom entity, and secondly, it needs to be attached and sent as an escalation mail and not using the front-end e-mail GUI.

I hope this makes sense and that some of you may have some ideas.

Thank you.

Kind regards,

Roelof