#1 2020-08-17 20:16:00

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Sending email with TDDDEmailerDaemon

Hi Ab, I am testing your TDDDEmailerDaemon class proposal, it works in a way that I need. There is a way to Inject this Class as a service just like we do with repositories?

Offline

#2 2020-08-18 06:02:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: Sending email with TDDDEmailerDaemon

Yes, you can just register the IDomUserEmailer service, with an implementation with this class, then use it in your code.

Offline

#3 2020-08-18 12:07:57

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: Sending email with TDDDEmailerDaemon

With normal servicedefine?

 aserver.ServiceDefine(TDDDEmailerDaemon,[IDomUserEmailer],sicShared);
         aserver.Services.Resolve(IDomUserEmailer, adom);  

Last edited by fabiovip2019 (2020-08-18 12:08:20)

Offline

#4 2020-08-18 13:10:28

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: Sending email with TDDDEmailerDaemon

If you want to publish it as a remote service.

But if you just need an internal dependency, no need to register as a service.
See e.g. https://tamingthemormot.wordpress.com/2 … ormot-way/
and the related documentation.

Offline

#5 2020-08-20 14:15:01

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: Sending email with TDDDEmailerDaemon

Cool Ab,
can i then use TSQLRestServer.ServiceContainer.InjectResolver to resolve this as an internal service? Would you like to call this implementation just by solving its interface, because its construction is complicated, or is it better to solve it with a dedicated constructor? It would be an internal service, I don't need to expose it as rest.

Last edited by fabiovip2019 (2020-08-20 14:22:46)

Offline

Board footer

Powered by FluxBB