@lovable.dev/email-js 0.1.2 → 0.2.0

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 CHANGED
@@ -82,6 +82,32 @@ await sendLovableEmail(
82
82
  All clients take the client options (`{ apiKey, apiBaseUrl?, authHeader? }`)
83
83
  as their last argument.
84
84
 
85
+ ### Cc and bcc
86
+
87
+ `cc` and `bcc` take arrays of addresses (`"a@b.com"` or `"Name <a@b.com>"`).
88
+ Cc recipients appear in the message's Cc header; bcc recipients receive the
89
+ message without appearing in any header. A send is limited to 5 recipients
90
+ across `to`, `cc`, and `bcc`, and the addresses must be distinct.
91
+
92
+ ```ts
93
+ await sendLovableEmail(
94
+ {
95
+ to: "user@example.com",
96
+ cc: ["manager@example.com"],
97
+ bcc: ["records@example.com"],
98
+ // ... as above
99
+ },
100
+ { apiKey },
101
+ );
102
+ ```
103
+
104
+ Two things to know: a cc/bcc recipient who previously unsubscribed or bounced
105
+ is silently dropped from the send (the primary recipient still gets it), and
106
+ unsubscribing is scoped to the primary `to` recipient — the link in the
107
+ message body and the mail client's native unsubscribe button both carry the
108
+ primary's token, so a cc'd reader using either one unsubscribes the primary
109
+ recipient.
110
+
85
111
  ### Listing email logs
86
112
 
87
113
  `listEmailLogs` returns recent delivery events for the calling project.
package/dist/index.d.cts CHANGED
@@ -11,6 +11,10 @@ interface EmailSendRequest {
11
11
  text: string;
12
12
  purpose?: string;
13
13
  reply_to?: string;
14
+ /** Visible in the Cc header. Max 5 recipients per send across to, cc, and bcc. */
15
+ cc?: string[];
16
+ /** Hidden — delivered via the envelope only, never in a header. Counts toward the 5-recipient cap. */
17
+ bcc?: string[];
14
18
  identity_id?: string;
15
19
  test_mode?: boolean;
16
20
  label?: string;
package/dist/index.d.ts CHANGED
@@ -11,6 +11,10 @@ interface EmailSendRequest {
11
11
  text: string;
12
12
  purpose?: string;
13
13
  reply_to?: string;
14
+ /** Visible in the Cc header. Max 5 recipients per send across to, cc, and bcc. */
15
+ cc?: string[];
16
+ /** Hidden — delivered via the envelope only, never in a header. Counts toward the 5-recipient cap. */
17
+ bcc?: string[];
14
18
  identity_id?: string;
15
19
  test_mode?: boolean;
16
20
  label?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/email-js",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Lovable Email JS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  "react-dom": "^19.0.0",
48
48
  "rimraf": "^5.0.0",
49
49
  "tsdown": "^0.22.5",
50
- "typescript": "^5",
50
+ "typescript": "7.0.2",
51
51
  "vitest": "^4.1.5",
52
52
  "@lovable/api-utils": "1.0.0"
53
53
  },