@schemavaults/send-email 0.5.0 → 0.6.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 +7 -6
- package/bun.lock +2 -2
- package/dist/cli.js +7417 -2203
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/send-email-request-body-schema.js +6 -2
- package/dist/send-email-request-body-schema.js.map +1 -1
- package/dist/validators/email-sender-schema.d.ts +6 -0
- package/dist/validators/email-sender-schema.js +26 -16
- package/dist/validators/email-sender-schema.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -81,22 +81,23 @@ bunx schemavaults-send-email --transport smtp-primary send \
|
|
|
81
81
|
|
|
82
82
|
Transport names are defined by whoever configures the mail-server; this package only validates that the value looks like an identifier. An unknown transport name is rejected by the mail-server, not by the client.
|
|
83
83
|
|
|
84
|
-
### Set the sender
|
|
84
|
+
### Set the sender and reply-to
|
|
85
85
|
|
|
86
|
-
`from`
|
|
86
|
+
`from` and `replyTo` are optional; without `from`, the mail-server sends from its configured default sender. Each takes a bare address, or a display name followed by the address in angle brackets. Wrap a display name in double quotes when it contains any of `( ) [ ] : ; @ ,`:
|
|
87
87
|
|
|
88
88
|
```ts
|
|
89
89
|
await sendEmail({
|
|
90
90
|
body: {
|
|
91
91
|
to: "user@example.com",
|
|
92
92
|
from: '"Example, Inc." <noreply@example.com>', // or "Example <noreply@example.com>", or "noreply@example.com"
|
|
93
|
+
replyTo: "Example Support <support@example.com>",
|
|
93
94
|
subject: "Hello",
|
|
94
95
|
message: { text: "Hello.", html: "<p>Hello.</p>" },
|
|
95
96
|
},
|
|
96
97
|
});
|
|
97
98
|
```
|
|
98
99
|
|
|
99
|
-
The address's domain must be one the mail-server's transport is set up to send from. On the CLI, pass the same
|
|
100
|
+
The `from` address's domain must be one the mail-server's transport is set up to send from. On the CLI, pass the same values to `--from` and `--reply-to`.
|
|
100
101
|
|
|
101
102
|
### Attach files
|
|
102
103
|
|
|
@@ -289,9 +290,9 @@ Zod schema for validating template IDs: lowercase alphanumeric with hyphens/unde
|
|
|
289
290
|
|
|
290
291
|
Zod schema for validating transport names: lowercase alphanumeric with hyphens/underscores, 1-64 characters, must start with a lowercase letter and end with a lowercase alphanumeric character. Whether a well-formed name corresponds to a transport the mail-server actually has configured is decided server-side.
|
|
291
292
|
|
|
292
|
-
### `emailSenderSchema`
|
|
293
|
+
### `emailSenderSchema` / `emailReplyToSchema`
|
|
293
294
|
|
|
294
|
-
Zod
|
|
295
|
+
Zod schemas for the `from` and `replyTo` fields (identical rules; each names its own field in error messages): a bare address (`noreply@example.com`) or a display name followed by the address in angle brackets (`Example <noreply@example.com>`). Display names may be Unicode; one containing any of `( ) [ ] : ; @ ,` must be wrapped in double quotes (`"Example, Inc." <noreply@example.com>`). Control characters, bidi formatting characters, and angle brackets, double quotes or backslashes inside the display name are rejected.
|
|
295
296
|
|
|
296
297
|
### `emailAttachmentSchema` / `emailAttachmentsSchema`
|
|
297
298
|
|
|
@@ -318,7 +319,7 @@ type SendEmailRequestBody = {
|
|
|
318
319
|
subject: string; // no line breaks or control characters (tabs allowed)
|
|
319
320
|
message: Message;
|
|
320
321
|
from?: string; // address or "Display Name <address>"; defaults to mail-server's configured sender
|
|
321
|
-
replyTo?: string;
|
|
322
|
+
replyTo?: string; // address or "Display Name <address>"
|
|
322
323
|
cc?: string | string[];
|
|
323
324
|
bcc?: string | string[];
|
|
324
325
|
dryRun?: boolean; // server validates without dispatching
|
package/bun.lock
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"name": "@schemavaults/send-email",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"commander": "14.0.1",
|
|
9
|
-
"zod": "4.
|
|
9
|
+
"zod": "^4.6.7",
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@eslint/js": "9.39.1",
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
|
|
353
353
|
"yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
|
|
354
354
|
|
|
355
|
-
"zod": ["zod@4.
|
|
355
|
+
"zod": ["zod@4.6.7", "", {}, "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg=="],
|
|
356
356
|
|
|
357
357
|
"@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
|
|
358
358
|
|