@veloxts/mail 0.6.57 → 0.6.59
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 +2 -25
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -1
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
# @veloxts/mail
|
|
2
2
|
|
|
3
|
-
> **Early Preview** - APIs may change
|
|
3
|
+
> **Early Preview (v0.6.x)** - APIs are stabilizing but may still change. Use with caution in production.
|
|
4
4
|
|
|
5
|
-
Email sending with React Email
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @veloxts/mail
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Quick Start
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
import { mailPlugin, defineMail } from '@veloxts/mail';
|
|
17
|
-
|
|
18
|
-
app.use(mailPlugin({ driver: 'log' }));
|
|
19
|
-
|
|
20
|
-
const WelcomeEmail = defineMail({
|
|
21
|
-
subject: ({ name }) => `Welcome, ${name}!`,
|
|
22
|
-
template: ({ name }) => <Text>Hello {name}, welcome to our app!</Text>,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
await ctx.mail.send(WelcomeEmail, { to: 'user@example.com', data: { name: 'John' } });
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
See [GUIDE.md](./GUIDE.md) for detailed documentation.
|
|
5
|
+
Email sending for VeloxTS Framework - provides SMTP and Resend drivers with React Email template support. Learn more at [@veloxts/velox](https://www.npmjs.com/package/@veloxts/velox).
|
|
29
6
|
|
|
30
7
|
## License
|
|
31
8
|
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,20 @@ export { createLogTransport, DRIVER_NAME as LOG_DRIVER } from './transports/log.
|
|
|
63
63
|
export { createResendTransport, DRIVER_NAME as RESEND_DRIVER } from './transports/resend.js';
|
|
64
64
|
export { createSmtpTransport, DRIVER_NAME as SMTP_DRIVER } from './transports/smtp.js';
|
|
65
65
|
export type { Attachment, EmailAddress, LogConfig, MailConfig, MailDefinitionConfig, MailDriver, MailEnvelope, MailPluginOptions, MailTransport, Recipient, RenderedMail, ResendConfig, SendMailOptions, SendResult, SmtpConfig, } from './types.js';
|
|
66
|
+
/**
|
|
67
|
+
* Utility functions for email processing.
|
|
68
|
+
*
|
|
69
|
+
* @deprecated Import from '@veloxts/mail/utils' instead. Will be removed in v2.0.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* // Old (deprecated):
|
|
74
|
+
* import { formatAddress, isValidEmail } from '@veloxts/mail';
|
|
75
|
+
*
|
|
76
|
+
* // New:
|
|
77
|
+
* import { formatAddress, isValidEmail } from '@veloxts/mail/utils';
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
66
80
|
export { escapeHtml, formatAddress, isValidEmail, normalizeRecipient, normalizeRecipients, sanitizeHeaderValue, stripHtml, validateRecipient, validateRecipients, validateTemplateName, } from './utils.js';
|
|
67
81
|
/**
|
|
68
82
|
* DI tokens and providers for @veloxts/mail
|
package/dist/index.js
CHANGED
|
@@ -66,7 +66,20 @@ export { closeMail, getMail, getMailFromInstance, initMail, mailPlugin, } from '
|
|
|
66
66
|
export { createLogTransport, DRIVER_NAME as LOG_DRIVER } from './transports/log.js';
|
|
67
67
|
export { createResendTransport, DRIVER_NAME as RESEND_DRIVER } from './transports/resend.js';
|
|
68
68
|
export { createSmtpTransport, DRIVER_NAME as SMTP_DRIVER } from './transports/smtp.js';
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Utility functions for email processing.
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Import from '@veloxts/mail/utils' instead. Will be removed in v2.0.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // Old (deprecated):
|
|
77
|
+
* import { formatAddress, isValidEmail } from '@veloxts/mail';
|
|
78
|
+
*
|
|
79
|
+
* // New:
|
|
80
|
+
* import { formatAddress, isValidEmail } from '@veloxts/mail/utils';
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
70
83
|
export { escapeHtml, formatAddress, isValidEmail, normalizeRecipient, normalizeRecipients, sanitizeHeaderValue, stripHtml, validateRecipient, validateRecipients, validateTemplateName, } from './utils.js';
|
|
71
84
|
// ============================================================================
|
|
72
85
|
// Dependency Injection
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/mail",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.59",
|
|
4
4
|
"description": "Email templating and sending for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,8 +8,12 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./utils": {
|
|
15
|
+
"types": "./dist/utils.d.ts",
|
|
16
|
+
"import": "./dist/utils.js"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
"files": [
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
"nodemailer": "6.10.1",
|
|
25
29
|
"resend": "4.1.2",
|
|
26
30
|
"zod": "3.24.4",
|
|
27
|
-
"@veloxts/core": "0.6.
|
|
31
|
+
"@veloxts/core": "0.6.59"
|
|
28
32
|
},
|
|
29
33
|
"devDependencies": {
|
|
30
34
|
"@biomejs/biome": "2.0.0",
|
|
@@ -36,7 +40,7 @@
|
|
|
36
40
|
"react": "19.2.3",
|
|
37
41
|
"typescript": "5.8.3",
|
|
38
42
|
"vitest": "4.0.16",
|
|
39
|
-
"@veloxts/testing": "0.6.
|
|
43
|
+
"@veloxts/testing": "0.6.59"
|
|
40
44
|
},
|
|
41
45
|
"peerDependencies": {
|
|
42
46
|
"fastify": "^5.0.0",
|