@flusys/nestjs-email 8.1.5 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -203,6 +203,10 @@ await this.emailSend.sendEmail({
203
203
  });
204
204
  ```
205
205
 
206
+ ### From other packages (`EMAIL_ADAPTER`)
207
+
208
+ `EmailModule` provides and exports `EMAIL_ADAPTER` (`nestjs-shared`), implemented by `EmailAdapter`: `send({ to, cc?, bcc?, replyTo?, emailConfigId?, subject, html?, text? }, user)` and `sendTemplate({ ...recipients, templateSlug, variables? }, user)`, both answering `{ success, messageId?, error? }`. It resolves the request-scoped `EmailSendService` per call, so singletons can inject it; a feature package injects it `@Optional()` and never imports this package (the entity builder's **Send email** flow step uses it).
209
+
206
210
  ## License
207
211
 
208
212
  MIT © FLUSYS
@@ -0,0 +1,9 @@
1
+ import { type IEmailAdapter, type IEmailAdapterContent, type IEmailAdapterResult, type IEmailAdapterTemplate, type ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
2
+ import { ModuleRef } from '@nestjs/core';
3
+ export declare class EmailAdapter implements IEmailAdapter {
4
+ private readonly moduleRef;
5
+ constructor(moduleRef: ModuleRef);
6
+ send(options: IEmailAdapterContent, user: ILoggedUserInfo | null): Promise<IEmailAdapterResult>;
7
+ sendTemplate(options: IEmailAdapterTemplate, user: ILoggedUserInfo | null): Promise<IEmailAdapterResult>;
8
+ private sender;
9
+ }
@@ -0,0 +1 @@
1
+ export * from './email.adapter.js';