@upyo/smtp 0.1.0-dev.11 → 0.1.0-dev.12
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 +5 -43
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -56,8 +56,8 @@ Usage
|
|
|
56
56
|
### Basic Email Sending
|
|
57
57
|
|
|
58
58
|
~~~~ typescript
|
|
59
|
+
import { createMessage } from "@upyo/core";
|
|
59
60
|
import { SmtpTransport } from "@upyo/smtp";
|
|
60
|
-
import { type Message } from "@upyo/core";
|
|
61
61
|
|
|
62
62
|
const transport = new SmtpTransport({
|
|
63
63
|
host: "smtp.example.com",
|
|
@@ -69,55 +69,17 @@ const transport = new SmtpTransport({
|
|
|
69
69
|
},
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
const message
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
ccRecipients: [],
|
|
76
|
-
bccRecipients: [],
|
|
77
|
-
replyRecipients: [],
|
|
72
|
+
const message = createMessage({
|
|
73
|
+
from: "sender@example.com",
|
|
74
|
+
to: "recipient@example.net",
|
|
78
75
|
subject: "Hello from Upyo!",
|
|
79
76
|
content: { text: "This is a test email." },
|
|
80
|
-
|
|
81
|
-
priority: "normal",
|
|
82
|
-
tags: [],
|
|
83
|
-
headers: new Headers(),
|
|
84
|
-
};
|
|
77
|
+
});
|
|
85
78
|
|
|
86
79
|
const receipt = await transport.send(message);
|
|
87
80
|
console.log("Email sent:", receipt.successful);
|
|
88
81
|
~~~~
|
|
89
82
|
|
|
90
|
-
### HTML Email with Attachments
|
|
91
|
-
|
|
92
|
-
~~~~ typescript
|
|
93
|
-
const message: Message = {
|
|
94
|
-
sender: { address: "sender@example.com" },
|
|
95
|
-
recipients: [{ address: "recipient@example.com" }],
|
|
96
|
-
ccRecipients: [],
|
|
97
|
-
bccRecipients: [],
|
|
98
|
-
replyRecipients: [],
|
|
99
|
-
subject: "HTML Email with Attachment",
|
|
100
|
-
content: {
|
|
101
|
-
html: "<h1>Hello!</h1><p>This is an <strong>HTML</strong> email.</p>",
|
|
102
|
-
text: "Hello!\nThis is an HTML email.",
|
|
103
|
-
},
|
|
104
|
-
attachments: [
|
|
105
|
-
{
|
|
106
|
-
filename: "document.pdf",
|
|
107
|
-
content: new Uint8Array(pdfBytes),
|
|
108
|
-
contentType: "application/pdf",
|
|
109
|
-
contentId: "doc1",
|
|
110
|
-
inline: false,
|
|
111
|
-
},
|
|
112
|
-
],
|
|
113
|
-
priority: "high",
|
|
114
|
-
tags: ["newsletter"],
|
|
115
|
-
headers: new Headers([["X-Campaign-ID", "12345"]]),
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const receipt = await transport.send(message);
|
|
119
|
-
~~~~
|
|
120
|
-
|
|
121
83
|
### Sending Multiple Emails
|
|
122
84
|
|
|
123
85
|
~~~~ typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upyo/smtp",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.12+d36debdf",
|
|
4
4
|
"description": "SMTP transport for Upyo email library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@upyo/core": "0.1.0-dev.
|
|
56
|
+
"@upyo/core": "0.1.0-dev.12+d36debdf"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@dotenvx/dotenvx": "^1.47.3",
|