@breadstone/archipel-mcp 0.0.33 → 0.0.34
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 +39 -15
- package/data/guides/email-templates.md +59 -27
- 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 +58 -0
- package/data/packages/platform-mailing/api/Class.LogDeliveryStrategy.md +71 -0
- package/data/packages/platform-mailing/api/Class.MailModule.md +2 -2
- 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 +2 -0
- package/data/packages/platform-mailing/api/Interface.IMailModuleOptions.md +4 -4
- package/data/packages/platform-mailing/api/Interface.IMailTemplateVariants.md +3 -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_TEMPLATE_FETCH_STRATEGY_TOKEN.md +1 -1
- package/data/packages/platform-mailing/api/Variable.MAIL_TEMPLATE_REPOSITORY_TOKEN.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 +3 -0
- package/package.json +1 -1
|
@@ -20,16 +20,16 @@ yarn add @breadstone/archipel-platform-mailing
|
|
|
20
20
|
|
|
21
21
|
## Choose a Delivery Strategy
|
|
22
22
|
|
|
23
|
-
`platform-mailing` supports multiple email providers
|
|
23
|
+
`platform-mailing` supports multiple email providers via **subpath exports**. Each delivery strategy is a separate entry point — only the provider you import is bundled (tree-shakeable).
|
|
24
24
|
|
|
25
|
-
| Strategy | Value for `MAIL_DELIVERY_STRATEGY` | When to use |
|
|
26
|
-
| ------------ | ---------------------------------- | ------------------------------------ |
|
|
27
|
-
| **SMTP** | `smtp` | Any SMTP server (self-hosted, relay) |
|
|
28
|
-
| **Postmark** | `postmark` | Postmark transactional email |
|
|
29
|
-
| **Resend** | `resend` | Resend API |
|
|
30
|
-
| **SendGrid** | `sendgrid` | Twilio SendGrid |
|
|
31
|
-
| **Mailgun** | `mailgun` | Mailgun API |
|
|
32
|
-
| **Log** | `log` | Development only — logs to console |
|
|
25
|
+
| Strategy | Subpath Import | Value for `MAIL_DELIVERY_STRATEGY` | When to use |
|
|
26
|
+
| ------------ | ----------------------------------------------------------- | ---------------------------------- | ------------------------------------ |
|
|
27
|
+
| **SMTP** | `@breadstone/archipel-platform-mailing/delivering/smtp` | `smtp` | Any SMTP server (self-hosted, relay) |
|
|
28
|
+
| **Postmark** | `@breadstone/archipel-platform-mailing/delivering/postmark` | `postmark` | Postmark transactional email |
|
|
29
|
+
| **Resend** | `@breadstone/archipel-platform-mailing/delivering/resend` | `resend` | Resend API |
|
|
30
|
+
| **SendGrid** | `@breadstone/archipel-platform-mailing/delivering/sendgrid` | `sendgrid` | Twilio SendGrid |
|
|
31
|
+
| **Mailgun** | `@breadstone/archipel-platform-mailing/delivering/mailgun` | `mailgun` | Mailgun API |
|
|
32
|
+
| **Log** | `@breadstone/archipel-platform-mailing/delivering/logger` | `log` | Development only — logs to console |
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -51,6 +51,28 @@ The module reads all configuration from environment variables. No `register()` c
|
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
+
## Package Structure & Tree-Shaking
|
|
55
|
+
|
|
56
|
+
`platform-mailing` uses **multi-entry-point subpath exports**. The main entry point exports only core contracts, services, and base classes. Each provider (delivery strategy or template strategy) is a **separate subpath** that you import independently:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
@breadstone/archipel-platform-mailing → Core (MailService, MailModule, ports, models, errors)
|
|
60
|
+
@breadstone/archipel-platform-mailing/delivering/smtp → SmtpDeliveryStrategy + SMTP_CONFIG_ENTRIES
|
|
61
|
+
@breadstone/archipel-platform-mailing/delivering/resend → ResendDeliveryStrategy + RESEND_CONFIG_ENTRIES
|
|
62
|
+
@breadstone/archipel-platform-mailing/delivering/postmark → PostmarkDeliveryStrategy + POSTMARK_CONFIG_ENTRIES
|
|
63
|
+
@breadstone/archipel-platform-mailing/delivering/sendgrid → SendGridDeliveryStrategy + SENDGRID_CONFIG_ENTRIES
|
|
64
|
+
@breadstone/archipel-platform-mailing/delivering/mailgun → MailgunDeliveryStrategy + MAILGUN_CONFIG_ENTRIES
|
|
65
|
+
@breadstone/archipel-platform-mailing/delivering/logger → LogDeliveryStrategy
|
|
66
|
+
@breadstone/archipel-platform-mailing/templating/file → FileTemplateFetchStrategy
|
|
67
|
+
@breadstone/archipel-platform-mailing/templating/blob → BlobTemplateFetchStrategy
|
|
68
|
+
@breadstone/archipel-platform-mailing/templating/database → DatabaseTemplateFetchStrategy
|
|
69
|
+
@breadstone/archipel-platform-mailing/health → MailHealthIndicator
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This ensures that importing the core package does **not** pull in provider-specific SDKs (e.g., `nodemailer`, `resend`, `@sendgrid/mail`). Only the subpath you import triggers a dependency on the corresponding SDK.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
54
76
|
## Configuration
|
|
55
77
|
|
|
56
78
|
### Core Variables
|
|
@@ -102,12 +124,13 @@ MAIL_MAILGUN_DOMAIN=mg.yourapp.com
|
|
|
102
124
|
|
|
103
125
|
### Template Strategies
|
|
104
126
|
|
|
105
|
-
Templates can be loaded from the filesystem or from
|
|
127
|
+
Templates can be loaded from the filesystem, from blob storage, or from a database — each via a dedicated **subpath export**:
|
|
106
128
|
|
|
107
|
-
| Strategy | Value for `MAIL_TEMPLATE_STRATEGY` | Description
|
|
108
|
-
|
|
|
109
|
-
| **File** | `file` | Load templates from a local directory
|
|
110
|
-
| **Blob** | `blob` | Load templates from `platform-blob-storage`
|
|
129
|
+
| Strategy | Subpath Import | Value for `MAIL_TEMPLATE_STRATEGY` | Description |
|
|
130
|
+
| ------------ | --------------------------------------------------------- | ---------------------------------- | ----------------------------------------------- |
|
|
131
|
+
| **File** | `@breadstone/archipel-platform-mailing/templating/file` | `file` | Load templates from a local directory |
|
|
132
|
+
| **Blob** | `@breadstone/archipel-platform-mailing/templating/blob` | `blob` | Load templates from `platform-blob-storage` |
|
|
133
|
+
| **Database** | `@breadstone/archipel-platform-mailing/templating/database` | `database` | Load templates from a database via repository |
|
|
111
134
|
|
|
112
135
|
For file-based templates, place your `.html` or `.txt` files in the configured template directory.
|
|
113
136
|
|
|
@@ -270,8 +293,9 @@ Map `MailDeliveryError` to an appropriate HTTP response in your global exception
|
|
|
270
293
|
## Development Tips
|
|
271
294
|
|
|
272
295
|
- Use `MAIL_DELIVERY_STRATEGY=log` during local development to see email content in the console without sending real emails.
|
|
273
|
-
- Use the **blob** template strategy when templates are shared across multiple services or managed by a CMS.
|
|
296
|
+
- Use the **blob** or **database** template strategy when templates are shared across multiple services or managed by a CMS.
|
|
274
297
|
- Template variables use the format defined by the template engine. Place templates in a well-organized directory structure (e.g., `templates/mail/welcome.html`).
|
|
298
|
+
- Only import the delivery/templating subpath you actually need — this keeps your bundle lean and avoids unnecessary peer dependency requirements.
|
|
275
299
|
|
|
276
300
|
---
|
|
277
301
|
|
|
@@ -14,20 +14,26 @@ This guide explains how to create email templates for `platform-mailing` and reg
|
|
|
14
14
|
|
|
15
15
|
## How It Works
|
|
16
16
|
|
|
17
|
-
`platform-mailing` does **not** ship ready-made template files. It defines a list of known template **names** and loads the actual content through
|
|
17
|
+
`platform-mailing` does **not** ship ready-made template files. It defines a list of known template **names** and loads the actual content through a **template-fetch strategy** at startup. Each strategy is available as a dedicated subpath export:
|
|
18
|
+
|
|
19
|
+
| Strategy | Subpath Import | Description |
|
|
20
|
+
| ------------ | ----------------------------------------------------------- | ---------------------------------------------- |
|
|
21
|
+
| **File** | `@breadstone/archipel-platform-mailing/templating/file` | Load from local filesystem via `ResourceManager` |
|
|
22
|
+
| **Blob** | `@breadstone/archipel-platform-mailing/templating/blob` | Load from blob storage via `BlobService` |
|
|
23
|
+
| **Database** | `@breadstone/archipel-platform-mailing/templating/database` | Load from database via `IMailTemplateRepository` |
|
|
18
24
|
|
|
19
25
|
```mermaid
|
|
20
26
|
flowchart LR
|
|
21
27
|
MailService["MailService<br/>sendTemplate()"] --> MailTemplateEngine["MailTemplateEngine<br/>compileTemplate()"]
|
|
22
|
-
MailTemplateEngine -->
|
|
28
|
+
MailTemplateEngine --> TemplateFetchStrategy["TemplateFetchStrategy<br/>(file / blob / database)"]
|
|
23
29
|
MailTemplateEngine --> ContentTemplateEngine["ContentTemplateEngine<br/>variable interpolation"]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
TemplateFetchStrategy --> FileTemplateFetchStrategy[FileTemplateFetchStrategy]
|
|
31
|
+
TemplateFetchStrategy --> BlobTemplateFetchStrategy[BlobTemplateFetchStrategy]
|
|
32
|
+
TemplateFetchStrategy --> DatabaseTemplateFetchStrategy[DatabaseTemplateFetchStrategy]
|
|
27
33
|
```
|
|
28
34
|
|
|
29
35
|
1. `MailService.sendTemplate()` passes the template name and context variables to `MailTemplateEngine`.
|
|
30
|
-
2. `MailTemplateEngine`
|
|
36
|
+
2. `MailTemplateEngine` delegates to the configured `TemplateFetchStrategy` (file, blob, or database) to load the template content.
|
|
31
37
|
3. `ContentTemplateEngine` from `platform-core` interpolates `{{placeholders}}` with the provided context.
|
|
32
38
|
4. The compiled string is handed to the configured delivery strategy (SMTP, Resend, Postmark, etc.).
|
|
33
39
|
|
|
@@ -55,16 +61,16 @@ The strategy loads `AuthRegister.html`, `AuthRegister.txt`, `AuthVerify.html`, e
|
|
|
55
61
|
|
|
56
62
|
Templates use a Handlebars-style syntax powered by `ContentTemplateEngine`:
|
|
57
63
|
|
|
58
|
-
| Syntax
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
64
|
+
| Syntax | Description |
|
|
65
|
+
| ------------------------------------- | --------------------------------- |
|
|
66
|
+
| `{{variableName}}` | Simple variable substitution |
|
|
67
|
+
| `{{#if condition}}...{{/if}}` | Conditional block |
|
|
68
|
+
| `{{#if condition}}...{{else}}...{{/if}}` | Conditional with else |
|
|
69
|
+
| `{{#unless condition}}...{{/unless}}` | Negative conditional |
|
|
70
|
+
| `{{#each items}}...{{/each}}` | Loop over array |
|
|
71
|
+
| `{{#with object}}...{{/with}}` | Context switching |
|
|
72
|
+
| `{{@index}}`, `{{@first}}`, `{{@last}}` | Loop metadata inside `#each` |
|
|
73
|
+
| `{{nested.property}}` | Dot notation for nested values |
|
|
68
74
|
|
|
69
75
|
### Example: `AuthVerify.html`
|
|
70
76
|
|
|
@@ -76,14 +82,14 @@ Templates use a Handlebars-style syntax powered by `ContentTemplateEngine`:
|
|
|
76
82
|
<title>Verify your email</title>
|
|
77
83
|
</head>
|
|
78
84
|
<body>
|
|
79
|
-
<h1>Hello,
|
|
85
|
+
<h1>Hello, {{userName}}!</h1>
|
|
80
86
|
<p>Please verify your email address by clicking the link below:</p>
|
|
81
87
|
<p>
|
|
82
|
-
<a href="
|
|
88
|
+
<a href="{{verificationUrl}}">Verify Email</a>
|
|
83
89
|
</p>
|
|
84
|
-
|
|
85
|
-
<p>This link expires in
|
|
86
|
-
|
|
90
|
+
{{#if expiresInHours}}
|
|
91
|
+
<p>This link expires in {{expiresInHours}} hours.</p>
|
|
92
|
+
{{/if}}
|
|
87
93
|
<p>If you did not create an account, you can safely ignore this email.</p>
|
|
88
94
|
</body>
|
|
89
95
|
</html>
|
|
@@ -92,13 +98,13 @@ Templates use a Handlebars-style syntax powered by `ContentTemplateEngine`:
|
|
|
92
98
|
### Example: `AuthVerify.txt`
|
|
93
99
|
|
|
94
100
|
```text
|
|
95
|
-
Hello,
|
|
101
|
+
Hello, {{userName}}!
|
|
96
102
|
|
|
97
103
|
Please verify your email address by visiting the following link:
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
{{verificationUrl}}
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
{{#if expiresInHours}}This link expires in {{expiresInHours}} hours.{{/if}}
|
|
102
108
|
|
|
103
109
|
If you did not create an account, you can safely ignore this email.
|
|
104
110
|
```
|
|
@@ -146,6 +152,7 @@ import { Module } from '@nestjs/common';
|
|
|
146
152
|
import { join } from 'node:path';
|
|
147
153
|
import { ResourceModule, FileResourceStrategy } from '@breadstone/archipel-platform-resources';
|
|
148
154
|
import { MailModule } from '@breadstone/archipel-platform-mailing';
|
|
155
|
+
import { FileTemplateFetchStrategy } from '@breadstone/archipel-platform-mailing/templating/file';
|
|
149
156
|
|
|
150
157
|
@Module({
|
|
151
158
|
imports: [
|
|
@@ -173,7 +180,11 @@ MAIL_TEMPLATE_STRATEGY=file
|
|
|
173
180
|
|
|
174
181
|
### Blob-Based Templates
|
|
175
182
|
|
|
176
|
-
For templates managed via a CMS or shared across multiple services, use `BlobTemplateFetchStrategy
|
|
183
|
+
For templates managed via a CMS or shared across multiple services, use `BlobTemplateFetchStrategy` from the `templating/blob` subpath. Upload a manifest file (`templates/templates.json`) and the template files to your blob storage:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
import { BlobTemplateFetchStrategy } from '@breadstone/archipel-platform-mailing/templating/blob';
|
|
187
|
+
```
|
|
177
188
|
|
|
178
189
|
**`templates/templates.json`**
|
|
179
190
|
```json
|
|
@@ -194,6 +205,26 @@ MAIL_TEMPLATE_STRATEGY=blob
|
|
|
194
205
|
|
|
195
206
|
The `BlobTemplateFetchStrategy` downloads the manifest, then fetches each listed file from blob storage via `BlobService` from `platform-blob-storage`.
|
|
196
207
|
|
|
208
|
+
### Database-Based Templates
|
|
209
|
+
|
|
210
|
+
For templates stored in a database (e.g., managed via an admin panel), use `DatabaseTemplateFetchStrategy` from the `templating/database` subpath:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import { DatabaseTemplateFetchStrategy } from '@breadstone/archipel-platform-mailing/templating/database';
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
This strategy loads templates through the `IMailTemplateRepository` port. You must provide an adapter implementation that fetches template records from your database:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
import { IMailTemplateRepository } from '@breadstone/archipel-platform-mailing';
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Set the environment variable:
|
|
223
|
+
|
|
224
|
+
```env
|
|
225
|
+
MAIL_TEMPLATE_STRATEGY=database
|
|
226
|
+
```
|
|
227
|
+
|
|
197
228
|
---
|
|
198
229
|
|
|
199
230
|
## Overriding Library Templates
|
|
@@ -291,12 +322,13 @@ Also check that `MAIL_TEMPLATE_STRATEGY` is set correctly (`file` or `blob`).
|
|
|
291
322
|
## Checklist
|
|
292
323
|
|
|
293
324
|
- [ ] Template files created for all required template names (`.html` and/or `.txt`)
|
|
294
|
-
- [ ] `ResourceModule.forRoot()` registered with base paths including your template directory
|
|
295
|
-
- [ ] `MAIL_TEMPLATE_STRATEGY` set to `file` or `
|
|
325
|
+
- [ ] `ResourceModule.forRoot()` registered with base paths including your template directory (for `file` strategy)
|
|
326
|
+
- [ ] `MAIL_TEMPLATE_STRATEGY` set to `file`, `blob`, or `database`
|
|
296
327
|
- [ ] `MAIL_TEMPLATE_ENGINE_FORMAT` set to `html` or `txt`
|
|
297
328
|
- [ ] Placeholders in templates match the keys passed in `templateParams`
|
|
298
329
|
- [ ] App-level overrides listed **before** library asset paths in `basePaths`
|
|
299
330
|
- [ ] `debug: true` used during development to verify template availability
|
|
331
|
+
- [ ] Only the needed templating subpath is imported (tree-shaking)
|
|
300
332
|
|
|
301
333
|
---
|
|
302
334
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: BlobTemplateFetchStrategy'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: BlobTemplateFetchStrategy
|
|
7
|
+
|
|
8
|
+
Defined in: [platform-mailing/src/templating/strategies/blob/BlobTemplateFetchStrategy.ts:16](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/blob/BlobTemplateFetchStrategy.ts#L16)
|
|
9
|
+
|
|
10
|
+
The `BlobTemplateFetchStrategy` class.
|
|
11
|
+
|
|
12
|
+
## Extends
|
|
13
|
+
|
|
14
|
+
- [`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase)
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new BlobTemplateFetchStrategy(blobService): BlobTemplateFetchStrategy;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [platform-mailing/src/templating/strategies/blob/BlobTemplateFetchStrategy.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/blob/BlobTemplateFetchStrategy.ts#L31)
|
|
25
|
+
|
|
26
|
+
Constructs a new instance of the `BlobTemplateFetchStrategy` class.
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type |
|
|
31
|
+
| ------ | ------ |
|
|
32
|
+
| `blobService` | `BlobService` |
|
|
33
|
+
|
|
34
|
+
#### Returns
|
|
35
|
+
|
|
36
|
+
`BlobTemplateFetchStrategy`
|
|
37
|
+
|
|
38
|
+
#### Overrides
|
|
39
|
+
|
|
40
|
+
[`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase).[`constructor`](Class.TemplateFetchStrategyBase#constructor)
|
|
41
|
+
|
|
42
|
+
## Methods
|
|
43
|
+
|
|
44
|
+
### load()
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
abstract load(): Promise<Record<string, IMailTemplateVariants>>;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Defined in: [platform-mailing/src/templating/strategies/blob/BlobTemplateFetchStrategy.ts:41](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/blob/BlobTemplateFetchStrategy.ts#L41)
|
|
51
|
+
|
|
52
|
+
Loads the templates.
|
|
53
|
+
|
|
54
|
+
#### Returns
|
|
55
|
+
|
|
56
|
+
`Promise`\<`Record`\<`string`, [`IMailTemplateVariants`](Interface.IMailTemplateVariants)\>\>
|
|
57
|
+
|
|
58
|
+
#### Overrides
|
|
59
|
+
|
|
60
|
+
[`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase).[`load`](Class.TemplateFetchStrategyBase#load)
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: DatabaseTemplateFetchStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/templating/strategies/DatabaseTemplateFetchStrategy.ts:22](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/DatabaseTemplateFetchStrategy.ts#L22)
|
|
8
|
+
Defined in: [platform-mailing/src/templating/strategies/database/DatabaseTemplateFetchStrategy.ts:22](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/database/DatabaseTemplateFetchStrategy.ts#L22)
|
|
9
9
|
|
|
10
10
|
Template fetch strategy that loads templates from a database via the
|
|
11
11
|
[IMailTemplateRepository](Interface.IMailTemplateRepository) port.
|
|
@@ -26,7 +26,7 @@ and caches them in-memory.
|
|
|
26
26
|
new DatabaseTemplateFetchStrategy(repository): DatabaseTemplateFetchStrategy;
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
Defined in: [platform-mailing/src/templating/strategies/DatabaseTemplateFetchStrategy.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/DatabaseTemplateFetchStrategy.ts#L32)
|
|
29
|
+
Defined in: [platform-mailing/src/templating/strategies/database/DatabaseTemplateFetchStrategy.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/database/DatabaseTemplateFetchStrategy.ts#L32)
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
@@ -50,7 +50,7 @@ Defined in: [platform-mailing/src/templating/strategies/DatabaseTemplateFetchStr
|
|
|
50
50
|
load(): Promise<Record<string, IMailTemplateVariants>>;
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
Defined in: [platform-mailing/src/templating/strategies/DatabaseTemplateFetchStrategy.ts:48](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/DatabaseTemplateFetchStrategy.ts#L48)
|
|
53
|
+
Defined in: [platform-mailing/src/templating/strategies/database/DatabaseTemplateFetchStrategy.ts:48](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/database/DatabaseTemplateFetchStrategy.ts#L48)
|
|
54
54
|
|
|
55
55
|
Loads all templates from the database and returns them grouped by key.
|
|
56
56
|
Only the default locale (no locale or first match) is loaded into the
|
|
@@ -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,58 @@
|
|
|
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:16](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts#L16)
|
|
9
|
+
|
|
10
|
+
The `FileTemplateFetchStrategy` class.
|
|
11
|
+
|
|
12
|
+
## Extends
|
|
13
|
+
|
|
14
|
+
- [`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase)
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new FileTemplateFetchStrategy(resourceManager): FileTemplateFetchStrategy;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts:26](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts#L26)
|
|
25
|
+
|
|
26
|
+
#### Parameters
|
|
27
|
+
|
|
28
|
+
| Parameter | Type |
|
|
29
|
+
| ------ | ------ |
|
|
30
|
+
| `resourceManager` | `ResourceManager` |
|
|
31
|
+
|
|
32
|
+
#### Returns
|
|
33
|
+
|
|
34
|
+
`FileTemplateFetchStrategy`
|
|
35
|
+
|
|
36
|
+
#### Overrides
|
|
37
|
+
|
|
38
|
+
[`TemplateFetchStrategyBase`](Class.TemplateFetchStrategyBase).[`constructor`](Class.TemplateFetchStrategyBase#constructor)
|
|
39
|
+
|
|
40
|
+
## Methods
|
|
41
|
+
|
|
42
|
+
### load()
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
load(): Promise<Record<string, IMailTemplateVariants>>;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Defined in: [platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts:40](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/templating/strategies/file/FileTemplateFetchStrategy.ts#L40)
|
|
49
|
+
|
|
50
|
+
Loads mail templates from the file system.
|
|
51
|
+
|
|
52
|
+
#### Returns
|
|
53
|
+
|
|
54
|
+
`Promise`\<`Record`\<`string`, [`IMailTemplateVariants`](Interface.IMailTemplateVariants)\>\>
|
|
55
|
+
|
|
56
|
+
#### Overrides
|
|
57
|
+
|
|
58
|
+
[`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,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: MailModule
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/MailModule.ts:67](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L67)
|
|
9
9
|
|
|
10
10
|
Represents the mail module.
|
|
11
11
|
|
|
@@ -32,7 +32,7 @@ new MailModule(): MailModule;
|
|
|
32
32
|
static register(options?): DynamicModule;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Defined in: [platform-mailing/src/
|
|
35
|
+
Defined in: [platform-mailing/src/MailModule.ts:76](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L76)
|
|
36
36
|
|
|
37
37
|
Registers the mail module with optional configuration.
|
|
38
38
|
|
|
@@ -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
|
|
|
@@ -11,6 +11,8 @@ 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
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Interface: IMailModuleOptions
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/
|
|
8
|
+
Defined in: [platform-mailing/src/MailModule.ts:28](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L28)
|
|
9
9
|
|
|
10
10
|
Options for configuring the [MailModule](Class.MailModule).
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ Options for configuring the [MailModule](Class.MailModule).
|
|
|
17
17
|
readonly optional configEntries?: readonly Omit<IConfigRegistryEntry<unknown>, "module">[];
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Defined in: [platform-mailing/src/
|
|
20
|
+
Defined in: [platform-mailing/src/MailModule.ts:39](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L39)
|
|
21
21
|
|
|
22
22
|
Additional or overriding configuration entries.
|
|
23
23
|
Merged with the platform default entries.
|
|
@@ -30,7 +30,7 @@ Merged with the platform default entries.
|
|
|
30
30
|
readonly optional isGlobal?: boolean;
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Defined in: [platform-mailing/src/
|
|
33
|
+
Defined in: [platform-mailing/src/MailModule.ts:33](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L33)
|
|
34
34
|
|
|
35
35
|
Whether to register the module globally.
|
|
36
36
|
Defaults to `true`.
|
|
@@ -43,7 +43,7 @@ Defaults to `true`.
|
|
|
43
43
|
readonly optional templateRepositoryProvider?: Provider<IMailTemplateRepository>;
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Defined in: [platform-mailing/src/
|
|
46
|
+
Defined in: [platform-mailing/src/MailModule.ts:55](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailModule.ts#L55)
|
|
47
47
|
|
|
48
48
|
Provider for the `IMailTemplateRepository` port.
|
|
49
49
|
Required when `MAIL_TEMPLATE_STRATEGY` is set to `'database'`.
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Interface: IMailTemplateVariants
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/MailTokens.ts:23](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailTokens.ts#L23)
|
|
8
|
+
Defined in: [platform-mailing/src/tokens/MailTokens.ts:23](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/tokens/MailTokens.ts#L23)
|
|
9
9
|
|
|
10
10
|
Represents the in-memory structure for a single template (multiple formats).
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ Represents the in-memory structure for a single template (multiple formats).
|
|
|
17
17
|
optional html?: string;
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Defined in: [platform-mailing/src/MailTokens.ts:24](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailTokens.ts#L24)
|
|
20
|
+
Defined in: [platform-mailing/src/tokens/MailTokens.ts:24](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/tokens/MailTokens.ts#L24)
|
|
21
21
|
|
|
22
22
|
***
|
|
23
23
|
|
|
@@ -27,4 +27,4 @@ Defined in: [platform-mailing/src/MailTokens.ts:24](https://github.com/RueDeRenn
|
|
|
27
27
|
optional txt?: string;
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Defined in: [platform-mailing/src/MailTokens.ts:25](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailTokens.ts#L25)
|
|
30
|
+
Defined in: [platform-mailing/src/tokens/MailTokens.ts:25](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/tokens/MailTokens.ts#L25)
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
type MailTemplateFormat = "html" | "txt";
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/MailTokens.ts:18](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailTokens.ts#L18)
|
|
12
|
+
Defined in: [platform-mailing/src/tokens/MailTokens.ts:18](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/tokens/MailTokens.ts#L18)
|
|
13
13
|
|
|
14
14
|
Union type of all supported template formats.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const MAILGUN_API_KEY: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/mailgun/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/mailgun/env.ts#L12)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/mailgun/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/mailgun/env.ts#L12)
|
|
13
13
|
|
|
14
14
|
API key for the Mailgun delivery service.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const MAILGUN_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, "module">>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/mailgun/env.ts:22](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/mailgun/env.ts#L22)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/mailgun/env.ts:22](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/mailgun/env.ts#L22)
|
|
13
13
|
|
|
14
14
|
Configuration entries required by the Mailgun delivery provider.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const MAILGUN_DOMAIN: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/mailgun/env.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/mailgun/env.ts#L15)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/mailgun/env.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/mailgun/env.ts#L15)
|
|
13
13
|
|
|
14
14
|
Mailgun domain (e.g. `mg.example.com`).
|
|
@@ -9,4 +9,4 @@ editUrl: false
|
|
|
9
9
|
const MAIL_DELIVERY_STRATEGY_TOKEN: typeof MAIL_DELIVERY_STRATEGY_TOKEN;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/MailTokens.ts:11](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailTokens.ts#L11)
|
|
12
|
+
Defined in: [platform-mailing/src/tokens/MailTokens.ts:11](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/tokens/MailTokens.ts#L11)
|
|
@@ -9,7 +9,7 @@ editUrl: false
|
|
|
9
9
|
const MAIL_TEMPLATE_FETCH_STRATEGY_TOKEN: typeof MAIL_TEMPLATE_FETCH_STRATEGY_TOKEN;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/MailTokens.ts:9](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailTokens.ts#L9)
|
|
12
|
+
Defined in: [platform-mailing/src/tokens/MailTokens.ts:9](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/tokens/MailTokens.ts#L9)
|
|
13
13
|
|
|
14
14
|
Central definition of injection tokens used by the mail module.
|
|
15
15
|
Using constants instead of raw string literals prevents accidental typos
|
|
@@ -9,4 +9,4 @@ editUrl: false
|
|
|
9
9
|
const MAIL_TEMPLATE_REPOSITORY_TOKEN: typeof MAIL_TEMPLATE_REPOSITORY_TOKEN;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/MailTokens.ts:13](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/MailTokens.ts#L13)
|
|
12
|
+
Defined in: [platform-mailing/src/tokens/MailTokens.ts:13](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/tokens/MailTokens.ts#L13)
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const POSTMARK_API_KEY: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/postmark/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/postmark/env.ts#L12)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/postmark/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/postmark/env.ts#L12)
|
|
13
13
|
|
|
14
14
|
API key for the Postmark delivery service.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const POSTMARK_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, "module">>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/postmark/env.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/postmark/env.ts#L19)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/postmark/env.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/postmark/env.ts#L19)
|
|
13
13
|
|
|
14
14
|
Configuration entries required by the Postmark delivery provider.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const RESEND_API_KEY: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/resend/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/resend/env.ts#L12)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/resend/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/resend/env.ts#L12)
|
|
13
13
|
|
|
14
14
|
API key for the Resend delivery service.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const RESEND_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, "module">>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/resend/env.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/resend/env.ts#L19)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/resend/env.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/resend/env.ts#L19)
|
|
13
13
|
|
|
14
14
|
Configuration entries required by the Resend delivery provider.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SENDGRID_API_KEY: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/sendgrid/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/sendgrid/env.ts#L12)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/sendgrid/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/sendgrid/env.ts#L12)
|
|
13
13
|
|
|
14
14
|
API key for the SendGrid delivery service.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SENDGRID_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, "module">>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/sendgrid/env.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/sendgrid/env.ts#L19)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/sendgrid/env.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/sendgrid/env.ts#L19)
|
|
13
13
|
|
|
14
14
|
Configuration entries required by the SendGrid delivery provider.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SMTP_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, "module">>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/smtp/env.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/smtp/env.ts#L31)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/env.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/env.ts#L31)
|
|
13
13
|
|
|
14
14
|
Configuration entries required by the SMTP delivery provider.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SMTP_HOST: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/smtp/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/smtp/env.ts#L12)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/env.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/env.ts#L12)
|
|
13
13
|
|
|
14
14
|
SMTP server host.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SMTP_PASSWORD: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/smtp/env.ts:24](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/smtp/env.ts#L24)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/env.ts:24](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/env.ts#L24)
|
|
13
13
|
|
|
14
14
|
SMTP authentication password.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SMTP_PORT: IConfigKey<number>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/smtp/env.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/smtp/env.ts#L15)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/env.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/env.ts#L15)
|
|
13
13
|
|
|
14
14
|
SMTP server port.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SMTP_SECURE: IConfigKey<boolean>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/smtp/env.ts:18](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/smtp/env.ts#L18)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/env.ts:18](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/env.ts#L18)
|
|
13
13
|
|
|
14
14
|
Whether the SMTP connection uses TLS.
|
|
@@ -9,6 +9,6 @@ editUrl: false
|
|
|
9
9
|
const SMTP_USER: IConfigKey<string>;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [platform-mailing/src/smtp/env.ts:21](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/smtp/env.ts#L21)
|
|
12
|
+
Defined in: [platform-mailing/src/delivering/strategies/smtp/env.ts:21](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/delivering/strategies/smtp/env.ts#L21)
|
|
13
13
|
|
|
14
14
|
SMTP authentication username.
|
|
@@ -9,8 +9,11 @@ editUrl: false
|
|
|
9
9
|
|
|
10
10
|
| Class | Description |
|
|
11
11
|
| ------ | ------ |
|
|
12
|
+
| [BlobTemplateFetchStrategy](Class.BlobTemplateFetchStrategy) | The `BlobTemplateFetchStrategy` class. |
|
|
12
13
|
| [DatabaseTemplateFetchStrategy](Class.DatabaseTemplateFetchStrategy) | Template fetch strategy that loads templates from a database via the [IMailTemplateRepository](Interface.IMailTemplateRepository) port. |
|
|
13
14
|
| [DeliveryStrategyBase](Class.DeliveryStrategyBase) | Represents the base class for all email delivery strategies. |
|
|
15
|
+
| [FileTemplateFetchStrategy](Class.FileTemplateFetchStrategy) | The `FileTemplateFetchStrategy` class. |
|
|
16
|
+
| [LogDeliveryStrategy](Class.LogDeliveryStrategy) | The `LogDeliveryStrategy` class. |
|
|
14
17
|
| [MailDeliveryError](Class.MailDeliveryError) | Domain error thrown when email delivery fails. |
|
|
15
18
|
| [MailgunDeliveryStrategy](Class.MailgunDeliveryStrategy) | Delivers emails via the Mailgun API. |
|
|
16
19
|
| [MailHealthIndicator](Class.MailHealthIndicator) | Health indicator for mail service. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breadstone/archipel-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"description": "MCP server providing Archipel platform knowledge - documentation, query patterns, and coding conventions - to AI development tools.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/main.js",
|