@upyo/smtp 0.1.0-dev.11 → 0.1.0-dev.13

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.
Files changed (2) hide show
  1. package/README.md +5 -43
  2. 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: Message = {
73
- sender: { name: "John Doe", address: "john@example.com" },
74
- recipients: [{ name: "Jane Doe", address: "jane@example.com" }],
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
- attachments: [],
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.11+9d41b08f",
3
+ "version": "0.1.0-dev.13+aad44636",
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.11+9d41b08f"
56
+ "@upyo/core": "0.1.0-dev.13+aad44636"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@dotenvx/dotenvx": "^1.47.3",