@breadstone/archipel-mcp 0.0.33 → 0.0.35
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/data/guides/email-delivery.md +68 -24
- package/data/guides/email-templates.md +80 -38
- package/data/packages/platform-feature-flags/api/Class.AzureFeatureFlagReader.md +9 -9
- package/data/packages/platform-feature-flags/api/Class.AzureFeatureFlagWriter.md +9 -9
- package/data/packages/platform-feature-flags/api/Class.FeatureFlagError.md +4 -4
- package/data/packages/platform-feature-flags/api/Class.FeatureFlagGuard.md +3 -3
- package/data/packages/platform-feature-flags/api/Class.FeatureFlagModule.md +2 -2
- package/data/packages/platform-feature-flags/api/Class.FeatureFlagReaderPort.md +6 -6
- package/data/packages/platform-feature-flags/api/Class.FeatureFlagWriterPort.md +7 -7
- package/data/packages/platform-feature-flags/api/Class.VercelFeatureFlagReader.md +8 -8
- package/data/packages/platform-feature-flags/api/Class.VercelFeatureFlagWriter.md +9 -9
- package/data/packages/platform-feature-flags/api/Function.FeatureFlag.md +1 -1
- package/data/packages/platform-feature-flags/api/Interface.IFeatureFlagContext.md +4 -4
- package/data/packages/platform-feature-flags/api/Interface.IFeatureFlagDefinition.md +6 -6
- package/data/packages/platform-feature-flags/api/Interface.IFeatureFlagEvaluation.md +4 -4
- package/data/packages/platform-feature-flags/api/Interface.IFeatureFlagModuleOptions.md +5 -5
- package/data/packages/platform-feature-flags/api/Variable.AZURE_APPCONFIG_CONNECTION_STRING.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.AZURE_APPCONFIG_ENDPOINT.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.AZURE_FEATURE_FLAG_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.AZURE_FEATURE_FLAG_KEY_FILTER.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.AZURE_FEATURE_FLAG_REFRESH_INTERVAL.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.FEATURE_FLAG_KEY_METADATA.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.PLATFORM_FEATURE_FLAGS_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_API_TOKEN.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_EDGE_CONFIG.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_EDGE_CONFIG_ID.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_EDGE_CONFIG_TOKEN.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_FEATURE_FLAG_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_FEATURE_FLAG_PREFIX.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_FEATURE_FLAG_WRITER_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-feature-flags/api/Variable.VERCEL_TEAM_ID.md +1 -1
- package/data/packages/platform-mailing/api/Class.BlobTemplateFetchStrategy.md +60 -0
- package/data/packages/platform-mailing/api/Class.DatabaseTemplateFetchStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.DeliveryStrategyBase.md +4 -3
- package/data/packages/platform-mailing/api/Class.FileTemplateFetchStrategy.md +62 -0
- package/data/packages/platform-mailing/api/Class.LogDeliveryStrategy.md +71 -0
- package/data/packages/platform-mailing/api/Class.MailModule.md +7 -7
- package/data/packages/platform-mailing/api/Class.MailService.md +11 -7
- package/data/packages/platform-mailing/api/Class.MailTemplateEngine.md +29 -4
- package/data/packages/platform-mailing/api/Class.MailgunDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.PostmarkDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.ResendDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.SendGridDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.SmtpDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.TemplateFetchStrategyBase.md +7 -11
- package/data/packages/platform-mailing/api/Interface.IMailEvents.md +28 -5
- package/data/packages/platform-mailing/api/Interface.IMailModuleOptions.md +50 -7
- package/data/packages/platform-mailing/api/Interface.IMailTemplateVariants.md +13 -3
- package/data/packages/platform-mailing/api/TypeAlias.MailTemplateFormat.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAILGUN_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAILGUN_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAILGUN_DOMAIN.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_DELIVERY_STRATEGY_TOKEN.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_HOST.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_MAILGUN_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_MAILGUN_DOMAIN.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_PORT.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_POSTMARK_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_RESEND_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_SENDER_EMAIL.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_SENDGRID_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_SMTP_HOST.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_SMTP_PASSWORD.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_SMTP_PORT.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_SMTP_SECURE.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_SMTP_USER.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_TEMPLATE_ENGINE_FORMAT.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_TEMPLATE_FETCH_STRATEGY_TOKEN.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_TEMPLATE_NAMES_TOKEN.md +12 -0
- package/data/packages/platform-mailing/api/Variable.MAIL_TEMPLATE_REPOSITORY_TOKEN.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_USER.md +1 -1
- package/data/packages/platform-mailing/api/Variable.PLATFORM_MAILING_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-mailing/api/Variable.POSTMARK_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.POSTMARK_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-mailing/api/Variable.RESEND_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.RESEND_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SENDGRID_API_KEY.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SENDGRID_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SMTP_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SMTP_HOST.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SMTP_PASSWORD.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SMTP_PORT.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SMTP_SECURE.md +1 -1
- package/data/packages/platform-mailing/api/Variable.SMTP_USER.md +1 -1
- package/data/packages/platform-mailing/api/index.md +4 -2
- package/package.json +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_DELIVERY_STRATEGY.md +0 -14
- package/data/packages/platform-mailing/api/Variable.MAIL_TEMPLATE_STRATEGY.md +0 -14
|
@@ -5,12 +5,13 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Abstract Class: DeliveryStrategyBase
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/delivering/strategies/abstracts/DeliveryStrategyBase.ts:9](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/abstracts/DeliveryStrategyBase.ts#L9)
|
|
9
9
|
|
|
10
10
|
Represents the base class for all email delivery strategies.
|
|
11
11
|
|
|
12
12
|
## Extended by
|
|
13
13
|
|
|
14
|
+
- [`LogDeliveryStrategy`](Class.LogDeliveryStrategy)
|
|
14
15
|
- [`SmtpDeliveryStrategy`](Class.SmtpDeliveryStrategy)
|
|
15
16
|
- [`PostmarkDeliveryStrategy`](Class.PostmarkDeliveryStrategy)
|
|
16
17
|
- [`ResendDeliveryStrategy`](Class.ResendDeliveryStrategy)
|
|
@@ -25,7 +26,7 @@ Represents the base class for all email delivery strategies.
|
|
|
25
26
|
protected new DeliveryStrategyBase(): DeliveryStrategyBase;
|
|
26
27
|
```
|
|
27
28
|
|
|
28
|
-
Defined in: [platform-mailing/src/
|
|
29
|
+
Defined in: [platform-mailing/src/delivering/strategies/abstracts/DeliveryStrategyBase.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/abstracts/DeliveryStrategyBase.ts#L17)
|
|
29
30
|
|
|
30
31
|
Initializes a new instance of the `DeliveryStrategyBase` class.
|
|
31
32
|
|
|
@@ -47,7 +48,7 @@ abstract send(
|
|
|
47
48
|
attachments?): Promise<void>;
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
Defined in: [platform-mailing/src/
|
|
51
|
+
Defined in: [platform-mailing/src/delivering/strategies/abstracts/DeliveryStrategyBase.ts:37](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/abstracts/DeliveryStrategyBase.ts#L37)
|
|
51
52
|
|
|
52
53
|
Sends an email with either plain text or HTML content.
|
|
53
54
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: FileTemplateFetchStrategy'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: FileTemplateFetchStrategy
|
|
7
|
+
|
|
8
|
+
Defined in: [platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts:20](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts#L20)
|
|
9
|
+
|
|
10
|
+
The `FileTemplateFetchStrategy` class.
|
|
11
|
+
|
|
12
|
+
Loads mail templates from the file system via `ResourceManager`.
|
|
13
|
+
Template names are injected via `MAIL_TEMPLATE_NAMES_TOKEN` — defaults to an empty array.
|
|
14
|
+
|
|
15
|
+
## Extends
|
|
16
|
+
|
|
17
|
+
- [`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase)
|
|
18
|
+
|
|
19
|
+
## Constructors
|
|
20
|
+
|
|
21
|
+
### Constructor
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
new FileTemplateFetchStrategy(resourceManager, templateNames): FileTemplateFetchStrategy;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Defined in: [platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts#L31)
|
|
28
|
+
|
|
29
|
+
#### Parameters
|
|
30
|
+
|
|
31
|
+
| Parameter | Type |
|
|
32
|
+
| ------ | ------ |
|
|
33
|
+
| `resourceManager` | `ResourceManager` |
|
|
34
|
+
| `templateNames` | readonly `string`[] |
|
|
35
|
+
|
|
36
|
+
#### Returns
|
|
37
|
+
|
|
38
|
+
`FileTemplateFetchStrategy`
|
|
39
|
+
|
|
40
|
+
#### Overrides
|
|
41
|
+
|
|
42
|
+
[`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase).[`constructor`](Class.TemplateFetchStrategyBase#constructor)
|
|
43
|
+
|
|
44
|
+
## Methods
|
|
45
|
+
|
|
46
|
+
### load()
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
load(): Promise<Record<string, IMailTemplateVariants>>;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Defined in: [platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts:46](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts#L46)
|
|
53
|
+
|
|
54
|
+
Loads mail templates from the file system.
|
|
55
|
+
|
|
56
|
+
#### Returns
|
|
57
|
+
|
|
58
|
+
`Promise`\<`Record`\<`string`, [`IMailTemplateVariants`](Interface.IMailTemplateVariants)\>\>
|
|
59
|
+
|
|
60
|
+
#### Overrides
|
|
61
|
+
|
|
62
|
+
[`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase).[`load`](Class.TemplateFetchStrategyBase#load)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: LogDeliveryStrategy'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: LogDeliveryStrategy
|
|
7
|
+
|
|
8
|
+
Defined in: [platform-mailing/src/delivering/strategies/logger/LogDeliveryStrategy.ts:13](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/logger/LogDeliveryStrategy.ts#L13)
|
|
9
|
+
|
|
10
|
+
The `LogDeliveryStrategy` class.
|
|
11
|
+
|
|
12
|
+
## Extends
|
|
13
|
+
|
|
14
|
+
- [`DeliveryStrategyBase`](Class.DeliveryStrategyBase)
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new LogDeliveryStrategy(): LogDeliveryStrategy;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [platform-mailing/src/delivering/strategies/logger/LogDeliveryStrategy.ts:27](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/logger/LogDeliveryStrategy.ts#L27)
|
|
25
|
+
|
|
26
|
+
Constructs a new instance of the `LogDelivery` class.
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`LogDeliveryStrategy`
|
|
31
|
+
|
|
32
|
+
#### Overrides
|
|
33
|
+
|
|
34
|
+
[`DeliveryStrategyBase`](Class.DeliveryStrategyBase).[`constructor`](Class.DeliveryStrategyBase#constructor)
|
|
35
|
+
|
|
36
|
+
## Methods
|
|
37
|
+
|
|
38
|
+
### send()
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
abstract send(
|
|
42
|
+
from,
|
|
43
|
+
to,
|
|
44
|
+
subject,
|
|
45
|
+
content,
|
|
46
|
+
isHtml,
|
|
47
|
+
_attachments?): Promise<void>;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Defined in: [platform-mailing/src/delivering/strategies/logger/LogDeliveryStrategy.ts:35](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/logger/LogDeliveryStrategy.ts#L35)
|
|
51
|
+
|
|
52
|
+
Sends an email with either plain text or HTML content.
|
|
53
|
+
|
|
54
|
+
#### Parameters
|
|
55
|
+
|
|
56
|
+
| Parameter | Type | Description |
|
|
57
|
+
| ------ | ------ | ------ |
|
|
58
|
+
| `from` | `string` | Sender's email address (optional, defaults to config) |
|
|
59
|
+
| `to` | `string` | Recipient's email address |
|
|
60
|
+
| `subject` | `string` | Subject of the email |
|
|
61
|
+
| `content` | `string` | Email body content (plain text or HTML) |
|
|
62
|
+
| `isHtml` | `boolean` | Flag to indicate whether the email is HTML (true) or plain text (false) |
|
|
63
|
+
| `_attachments?` | [`IMailAttachment`](Interface.IMailAttachment)[] | - |
|
|
64
|
+
|
|
65
|
+
#### Returns
|
|
66
|
+
|
|
67
|
+
`Promise`\<`void`\>
|
|
68
|
+
|
|
69
|
+
#### Overrides
|
|
70
|
+
|
|
71
|
+
[`DeliveryStrategyBase`](Class.DeliveryStrategyBase).[`send`](Class.DeliveryStrategyBase#send)
|
|
@@ -5,12 +5,12 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: MailModule
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/MailModule.ts:91](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L91)
|
|
9
9
|
|
|
10
10
|
Represents the mail module.
|
|
11
11
|
|
|
12
|
-
Delivery and template strategies are
|
|
13
|
-
|
|
12
|
+
Delivery and template strategies are selected at compile time via
|
|
13
|
+
`IMailModuleOptions`. NestJS DI resolves the concrete classes.
|
|
14
14
|
|
|
15
15
|
## Constructors
|
|
16
16
|
|
|
@@ -29,18 +29,18 @@ new MailModule(): MailModule;
|
|
|
29
29
|
### register()
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
|
-
static register(options
|
|
32
|
+
static register(options): DynamicModule;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Defined in: [platform-mailing/src/
|
|
35
|
+
Defined in: [platform-mailing/src/MailModule.ts:102](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L102)
|
|
36
36
|
|
|
37
|
-
Registers the mail module with
|
|
37
|
+
Registers the mail module with the specified configuration.
|
|
38
38
|
|
|
39
39
|
#### Parameters
|
|
40
40
|
|
|
41
41
|
| Parameter | Type | Description |
|
|
42
42
|
| ------ | ------ | ------ |
|
|
43
|
-
| `options
|
|
43
|
+
| `options` | [`IMailModuleOptions`](Interface.IMailModuleOptions) | Module registration options. |
|
|
44
44
|
|
|
45
45
|
#### Returns
|
|
46
46
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: MailService
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/services/MailService.ts:
|
|
8
|
+
Defined in: [platform-mailing/src/services/MailService.ts:20](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/MailService.ts#L20)
|
|
9
9
|
|
|
10
10
|
Represents the `MailService` class.
|
|
11
11
|
|
|
@@ -20,7 +20,7 @@ new MailService(
|
|
|
20
20
|
deliveryStrategy): MailService;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Defined in: [platform-mailing/src/services/MailService.ts:
|
|
23
|
+
Defined in: [platform-mailing/src/services/MailService.ts:37](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/MailService.ts#L37)
|
|
24
24
|
|
|
25
25
|
Constructs a new instance of the `MailService` class.
|
|
26
26
|
|
|
@@ -48,7 +48,7 @@ send(
|
|
|
48
48
|
attachments?): Promise<void>;
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
Defined in: [platform-mailing/src/services/MailService.ts:
|
|
51
|
+
Defined in: [platform-mailing/src/services/MailService.ts:67](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/MailService.ts#L67)
|
|
52
52
|
|
|
53
53
|
Sends an email with either plain text or HTML content.
|
|
54
54
|
|
|
@@ -76,22 +76,26 @@ Sends an email with either plain text or HTML content.
|
|
|
76
76
|
sendTemplate(mailOptions, templateOptions): Promise<void>;
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
Defined in: [platform-mailing/src/services/MailService.ts:
|
|
79
|
+
Defined in: [platform-mailing/src/services/MailService.ts:105](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/MailService.ts#L105)
|
|
80
80
|
|
|
81
81
|
Sends an email using a predefined template (HTML or text).
|
|
82
82
|
Automatically uses the template format (either 'html' or 'txt') based on the environment variable.
|
|
83
83
|
|
|
84
|
+
When no `subject` is provided in `mailOptions`, the subject is resolved from the
|
|
85
|
+
stored template and interpolated with the given `templateParams` (industry-standard
|
|
86
|
+
behavior matching Mailchimp/SendGrid/Postmark).
|
|
87
|
+
|
|
84
88
|
#### Parameters
|
|
85
89
|
|
|
86
90
|
| Parameter | Type | Description |
|
|
87
91
|
| ------ | ------ | ------ |
|
|
88
|
-
| `mailOptions` | \{ `from?`: `string`; `subject
|
|
92
|
+
| `mailOptions` | \{ `from?`: `string`; `subject?`: `string`; `to`: `string`; \} | - |
|
|
89
93
|
| `mailOptions.from?` | `string` | Sender's email address (optional, defaults to config) |
|
|
90
|
-
| `mailOptions.subject
|
|
94
|
+
| `mailOptions.subject?` | `string` | Subject of the email (optional — resolved from template if omitted) |
|
|
91
95
|
| `mailOptions.to` | `string` | Recipient's email address |
|
|
92
96
|
| `templateOptions` | \{ `templateName`: `string`; `templateParams`: `Record`\<`string`, `string` \| `number` \| `boolean` \| `Date` \| `undefined` \| `null`\>; \} | - |
|
|
93
97
|
| `templateOptions.templateName` | `string` | Name of the template to be used |
|
|
94
|
-
| `templateOptions.templateParams` | `Record`\<`string`, `string` \| `number` \| `boolean` \| `Date` \| `undefined` \| `null`\> |
|
|
98
|
+
| `templateOptions.templateParams` | `Record`\<`string`, `string` \| `number` \| `boolean` \| `Date` \| `undefined` \| `null`\> | Parameters to inject into the template |
|
|
95
99
|
|
|
96
100
|
#### Returns
|
|
97
101
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: MailTemplateEngine
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:
|
|
8
|
+
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:18](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/MailTemplateEngine.ts#L18)
|
|
9
9
|
|
|
10
10
|
The `MailTemplateEngine` class.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ The `MailTemplateEngine` class.
|
|
|
21
21
|
new MailTemplateEngine(templateFetchStrategy, contentTemplateEngine): MailTemplateEngine;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:
|
|
24
|
+
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:34](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/MailTemplateEngine.ts#L34)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `MailTemplateEngine` class.
|
|
27
27
|
|
|
@@ -47,7 +47,7 @@ compileTemplate(
|
|
|
47
47
|
format): string;
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:
|
|
50
|
+
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:67](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/MailTemplateEngine.ts#L67)
|
|
51
51
|
|
|
52
52
|
Compiles a template by replacing placeholders with the provided parameters.
|
|
53
53
|
|
|
@@ -77,7 +77,7 @@ Error if the template or format is not found.
|
|
|
77
77
|
onModuleInit(): Promise<void>;
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:
|
|
80
|
+
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:53](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/MailTemplateEngine.ts#L53)
|
|
81
81
|
|
|
82
82
|
Lifecycle hook that runs after the module initialization.
|
|
83
83
|
Loads all templates from the disk and caches them in memory.
|
|
@@ -91,3 +91,28 @@ Loads all templates from the disk and caches them in memory.
|
|
|
91
91
|
```ts
|
|
92
92
|
OnModuleInit.onModuleInit
|
|
93
93
|
```
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### resolveSubject()
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
resolveSubject(templateKey, params): string | undefined;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Defined in: [platform-mailing/src/templating/MailTemplateEngine.ts:97](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/MailTemplateEngine.ts#L97)
|
|
104
|
+
|
|
105
|
+
Resolves and interpolates the subject line from a stored template.
|
|
106
|
+
|
|
107
|
+
#### Parameters
|
|
108
|
+
|
|
109
|
+
| Parameter | Type | Description |
|
|
110
|
+
| ------ | ------ | ------ |
|
|
111
|
+
| `templateKey` | `string` | The key of the template. |
|
|
112
|
+
| `params` | `Record`\<`string`, `unknown`\> | The parameters to insert into the subject. |
|
|
113
|
+
|
|
114
|
+
#### Returns
|
|
115
|
+
|
|
116
|
+
`string` \| `undefined`
|
|
117
|
+
|
|
118
|
+
The compiled subject string, or `undefined` if no subject is stored.
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: MailgunDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/delivering/strategies/mailgun/MailgunDeliveryStrategy.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/mailgun/MailgunDeliveryStrategy.ts#L19)
|
|
9
9
|
|
|
10
10
|
Delivers emails via the Mailgun API.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ Delivers emails via the Mailgun API.
|
|
|
21
21
|
new MailgunDeliveryStrategy(configService): MailgunDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/
|
|
24
|
+
Defined in: [platform-mailing/src/delivering/strategies/mailgun/MailgunDeliveryStrategy.ts:35](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/mailgun/MailgunDeliveryStrategy.ts#L35)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `MailgunDeliveryStrategy` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/
|
|
56
|
+
Defined in: [platform-mailing/src/delivering/strategies/mailgun/MailgunDeliveryStrategy.ts:60](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/mailgun/MailgunDeliveryStrategy.ts#L60)
|
|
57
57
|
|
|
58
58
|
Sends an email using the Mailgun transport.
|
|
59
59
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: PostmarkDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/delivering/strategies/postmark/PostmarkDeliveryStrategy.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/postmark/PostmarkDeliveryStrategy.ts#L17)
|
|
9
9
|
|
|
10
10
|
The `PostmarkDeliveryStrategy` class.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ The `PostmarkDeliveryStrategy` class.
|
|
|
21
21
|
new PostmarkDeliveryStrategy(configService): PostmarkDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/
|
|
24
|
+
Defined in: [platform-mailing/src/delivering/strategies/postmark/PostmarkDeliveryStrategy.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/postmark/PostmarkDeliveryStrategy.ts#L32)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `PostmarkDeliveryStrategy` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/
|
|
56
|
+
Defined in: [platform-mailing/src/delivering/strategies/postmark/PostmarkDeliveryStrategy.ts:52](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/postmark/PostmarkDeliveryStrategy.ts#L52)
|
|
57
57
|
|
|
58
58
|
Sends an email using the Postmark transport.
|
|
59
59
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: ResendDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/delivering/strategies/resend/ResendDeliveryStrategy.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/resend/ResendDeliveryStrategy.ts#L17)
|
|
9
9
|
|
|
10
10
|
Delivers emails via the Resend API.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ Delivers emails via the Resend API.
|
|
|
21
21
|
new ResendDeliveryStrategy(configService): ResendDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/
|
|
24
|
+
Defined in: [platform-mailing/src/delivering/strategies/resend/ResendDeliveryStrategy.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/resend/ResendDeliveryStrategy.ts#L32)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `ResendDeliveryStrategy` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/
|
|
56
|
+
Defined in: [platform-mailing/src/delivering/strategies/resend/ResendDeliveryStrategy.ts:52](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/resend/ResendDeliveryStrategy.ts#L52)
|
|
57
57
|
|
|
58
58
|
Sends an email using the Resend transport.
|
|
59
59
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: SendGridDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/delivering/strategies/sendgrid/SendGridDeliveryStrategy.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/sendgrid/SendGridDeliveryStrategy.ts#L17)
|
|
9
9
|
|
|
10
10
|
Delivers emails via the SendGrid API.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ Delivers emails via the SendGrid API.
|
|
|
21
21
|
new SendGridDeliveryStrategy(configService): SendGridDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/
|
|
24
|
+
Defined in: [platform-mailing/src/delivering/strategies/sendgrid/SendGridDeliveryStrategy.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/sendgrid/SendGridDeliveryStrategy.ts#L31)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `SendGridDeliveryStrategy` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/
|
|
56
|
+
Defined in: [platform-mailing/src/delivering/strategies/sendgrid/SendGridDeliveryStrategy.ts:51](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/sendgrid/SendGridDeliveryStrategy.ts#L51)
|
|
57
57
|
|
|
58
58
|
Sends an email using the SendGrid transport.
|
|
59
59
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: SmtpDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/SmtpDeliveryStrategy.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/SmtpDeliveryStrategy.ts#L17)
|
|
9
9
|
|
|
10
10
|
The `SmtpDeliveryStrategy` class.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ The `SmtpDeliveryStrategy` class.
|
|
|
21
21
|
new SmtpDeliveryStrategy(configService): SmtpDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/
|
|
24
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/SmtpDeliveryStrategy.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/SmtpDeliveryStrategy.ts#L32)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `LogDelivery` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/
|
|
56
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/SmtpDeliveryStrategy.ts:62](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/SmtpDeliveryStrategy.ts#L62)
|
|
57
57
|
|
|
58
58
|
Sends an email using the SMTP transport.
|
|
59
59
|
|
|
@@ -5,12 +5,14 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Abstract Class: TemplateFetchStrategyBase
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts:
|
|
8
|
+
Defined in: [platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts:9](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts#L9)
|
|
9
9
|
|
|
10
10
|
Represents the base class for template fetch strategies.
|
|
11
11
|
|
|
12
12
|
## Extended by
|
|
13
13
|
|
|
14
|
+
- [`BlobTemplateFetchStrategy`](Class.BlobTemplateFetchStrategy)
|
|
15
|
+
- [`FileTemplateFetchStrategy`](Class.FileTemplateFetchStrategy)
|
|
14
16
|
- [`DatabaseTemplateFetchStrategy`](Class.DatabaseTemplateFetchStrategy)
|
|
15
17
|
|
|
16
18
|
## Constructors
|
|
@@ -21,7 +23,7 @@ Represents the base class for template fetch strategies.
|
|
|
21
23
|
protected new TemplateFetchStrategyBase(): TemplateFetchStrategyBase;
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
Defined in: [platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts:
|
|
26
|
+
Defined in: [platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts#L17)
|
|
25
27
|
|
|
26
28
|
Initializes a new instance of the `TemplateFetchStrategyBase` class.
|
|
27
29
|
|
|
@@ -34,19 +36,13 @@ Initializes a new instance of the `TemplateFetchStrategyBase` class.
|
|
|
34
36
|
### load()
|
|
35
37
|
|
|
36
38
|
```ts
|
|
37
|
-
abstract load(): Promise<Record<string,
|
|
38
|
-
html?: string;
|
|
39
|
-
txt?: string;
|
|
40
|
-
}>>;
|
|
39
|
+
abstract load(): Promise<Record<string, IMailTemplateVariants>>;
|
|
41
40
|
```
|
|
42
41
|
|
|
43
|
-
Defined in: [platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts:
|
|
42
|
+
Defined in: [platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/abstracts/TemplateFetchStrategyBase.ts#L31)
|
|
44
43
|
|
|
45
44
|
Loads the templates.
|
|
46
45
|
|
|
47
46
|
#### Returns
|
|
48
47
|
|
|
49
|
-
`Promise`\<`Record`\<`string`,
|
|
50
|
-
`html?`: `string`;
|
|
51
|
-
`txt?`: `string`;
|
|
52
|
-
\}\>\>
|
|
48
|
+
`Promise`\<`Record`\<`string`, [`IMailTemplateVariants`](Interface.IMailTemplateVariants)\>\>
|
|
@@ -5,10 +5,14 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Interface: IMailEvents
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/events/IMailEvents.ts:
|
|
8
|
+
Defined in: [platform-mailing/src/events/IMailEvents.ts:16](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/events/IMailEvents.ts#L16)
|
|
9
9
|
|
|
10
10
|
Represents the contract of events emitted by the mail domain.
|
|
11
11
|
|
|
12
|
+
Publishers only need to specify `recipientEmail`, `templateName`, and `templateParams`.
|
|
13
|
+
The subject is resolved from the stored template (industry-standard behavior).
|
|
14
|
+
An explicit `subject` can be provided as an override.
|
|
15
|
+
|
|
12
16
|
## Extends
|
|
13
17
|
|
|
14
18
|
- `IEventMap`
|
|
@@ -25,15 +29,24 @@ Represents the contract of events emitted by the mail domain.
|
|
|
25
29
|
|
|
26
30
|
```ts
|
|
27
31
|
sendMail: {
|
|
32
|
+
locale?: string;
|
|
28
33
|
recipientEmail: string;
|
|
29
34
|
senderEmail?: string;
|
|
30
|
-
subject
|
|
35
|
+
subject?: string;
|
|
31
36
|
templateName: string;
|
|
32
37
|
templateParams: Record<string, string | number | boolean | Date | undefined | null>;
|
|
33
38
|
};
|
|
34
39
|
```
|
|
35
40
|
|
|
36
|
-
Defined in: [platform-mailing/src/events/IMailEvents.ts:
|
|
41
|
+
Defined in: [platform-mailing/src/events/IMailEvents.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/events/IMailEvents.ts#L17)
|
|
42
|
+
|
|
43
|
+
#### locale?
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
optional locale?: string;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Optional locale for template resolution (e.g. `'de'`, `'en'`).
|
|
37
50
|
|
|
38
51
|
#### recipientEmail
|
|
39
52
|
|
|
@@ -41,26 +54,36 @@ Defined in: [platform-mailing/src/events/IMailEvents.ts:13](https://github.com/R
|
|
|
41
54
|
recipientEmail: string;
|
|
42
55
|
```
|
|
43
56
|
|
|
57
|
+
Recipient email address.
|
|
58
|
+
|
|
44
59
|
#### senderEmail?
|
|
45
60
|
|
|
46
61
|
```ts
|
|
47
62
|
optional senderEmail?: string;
|
|
48
63
|
```
|
|
49
64
|
|
|
50
|
-
|
|
65
|
+
Optional sender email override. When omitted, uses the configured default.
|
|
66
|
+
|
|
67
|
+
#### subject?
|
|
51
68
|
|
|
52
69
|
```ts
|
|
53
|
-
subject
|
|
70
|
+
optional subject?: string;
|
|
54
71
|
```
|
|
55
72
|
|
|
73
|
+
Optional subject override. When omitted, resolved from the template.
|
|
74
|
+
|
|
56
75
|
#### templateName
|
|
57
76
|
|
|
58
77
|
```ts
|
|
59
78
|
templateName: string;
|
|
60
79
|
```
|
|
61
80
|
|
|
81
|
+
Template key to resolve (e.g. `'AuthRegister'`).
|
|
82
|
+
|
|
62
83
|
#### templateParams
|
|
63
84
|
|
|
64
85
|
```ts
|
|
65
86
|
templateParams: Record<string, string | number | boolean | Date | undefined | null>;
|
|
66
87
|
```
|
|
88
|
+
|
|
89
|
+
Placeholder values to interpolate into subject and body.
|