@nxgt/mail-resend 0.3.0 → 0.3.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 CHANGED
@@ -71,7 +71,7 @@ await mailer.send({
71
71
  to: [{ name: 'Doe, John', address: 'john@example.com' }],
72
72
  from: 'billing@acme.test', // required here: this mailer has no default
73
73
  replyTo: 'support@acme.test', // sent as reply_to
74
- headers: { 'List-Unsubscribe': '<https://acme.test/unsubscribe>' },
74
+ headers: { 'X-Entity-Ref-ID': 'invoice-42' },
75
75
  subject: 'Your invoice',
76
76
  html: '<p>…</p>',
77
77
  text: '…',
@@ -84,6 +84,9 @@ await mailer.send({
84
84
  - A name is sent as a quoted string — `"Doe, John" <john@example.com>` — so a
85
85
  comma or an angle bracket in it never names another recipient.
86
86
  - `messageId` is Resend's `id`, or `null` when the answer carries none.
87
+ - For marketing mail, build `List-Unsubscribe` and `List-Unsubscribe-Post`
88
+ with `listUnsubscribe` from `@nxgt/mail` rather than by hand — see
89
+ [one-click unsubscribe](https://github.com/softistx/nxgt-mail/blob/develop/packages/mail/docs/guide/sending.md#one-click-unsubscribe).
87
90
 
88
91
  ### Attachments
89
92
 
@@ -148,7 +148,7 @@ const mailer = createResendMailer({ apiKey: process.env.RESEND_API_KEY ?? '', ti
148
148
  await mailer.send({
149
149
  to: ['ada@example.com', { name: 'Doe, "John"', address: 'john@example.com' }],
150
150
  replyTo: 'support@acme.test',
151
- headers: { 'List-Unsubscribe': '<https://acme.test/u>' },
151
+ headers: { 'X-Entity-Ref-ID': 'invoice-42' },
152
152
  subject: 'Hi',
153
153
  html: '<p>Hi</p>',
154
154
  text: 'Hi',
@@ -169,7 +169,7 @@ Content-Type: application/json
169
169
  "html": "<p>Hi</p>",
170
170
  "text": "Hi",
171
171
  "reply_to": "support@acme.test",
172
- "headers": { "List-Unsubscribe": "<https://acme.test/u>" },
172
+ "headers": { "X-Entity-Ref-ID": "invoice-42" },
173
173
  "attachments": [
174
174
  { "filename": "hello.txt", "content": "SGVsbG8=", "content_type": "text/plain" }
175
175
  ]
@@ -189,6 +189,11 @@ Content-Type: application/json
189
189
 
190
190
  - `replyTo` is sent as `reply_to`, Resend's name for it; `reply_to` and
191
191
  `headers` are left out when the message has none.
192
+ - `headers` are sent as written, and Resend DKIM-signs the message with your
193
+ domain's key — check that the `DKIM-Signature` of a received message names
194
+ the headers you rely on in `h=`; build `List-Unsubscribe` with `listUnsubscribe` from
195
+ `@nxgt/mail` — see
196
+ [one-click unsubscribe](https://github.com/softistx/nxgt-mail/blob/develop/packages/mail/docs/guide/sending.md#one-click-unsubscribe).
192
197
  - Each attachment is sent as `{ filename, content, content_type }`: its bytes
193
198
  as base64, encoded in slices with `btoa` — no `Buffer`, so it runs on an
194
199
  edge runtime — and its type as `content_type`, Resend's name for it.
package/docs/roadmap.md CHANGED
@@ -5,13 +5,7 @@ no dates here, and the version something shipped in is the only number.
5
5
 
6
6
  ## Now
7
7
 
8
- - **An idempotency key per send** — a message's `idempotencyKey` is sent as
9
- Resend's `Idempotency-Key` header, so a retry the caller decides, within
10
- Resend's 24 hours, answers the first send's id and cannot send the same
11
- e-mail twice. A `409 invalid_idempotent_request` (the key already used for
12
- another message) is a `MailRefused`; a `409 concurrent_idempotent_requests`
13
- (the same key still in progress) stays a `MailFailure`. Needs `@nxgt/mail`
14
- 0.3. Built, not yet published.
8
+ Nothing yet.
15
9
 
16
10
  ## Next
17
11
 
@@ -38,6 +32,13 @@ Nothing yet.
38
32
  The last ten, newest first, each with the version it came in. Everything
39
33
  before is in the [CHANGELOG](../CHANGELOG.md).
40
34
 
35
+ - **An idempotency key per send, v0.3.0** — a message's `idempotencyKey` is sent as
36
+ Resend's `Idempotency-Key` header, so a retry the caller decides, within
37
+ Resend's 24 hours, answers the first send's id and cannot send the same
38
+ e-mail twice. A `409 invalid_idempotent_request` (the key already used for
39
+ another message) is a `MailRefused`; a `409 concurrent_idempotent_requests`
40
+ (the same key still in progress) stays a `MailFailure`. Needs `@nxgt/mail`
41
+ 0.3.
41
42
  - **Attachments, v0.2.0** — the `attachments` of a message are sent in Resend's
42
43
  `attachments`, each as `{ filename, content, content_type }` with the bytes
43
44
  in base64, encoded with no Node built-in so the transport still runs on an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/mail-resend",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "A Resend transport for @nxgt/mail over fetch, with no SDK: it throws the MailFailure and MailRefused of its @nxgt/mail peer, and passes the conformance suite.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -43,11 +43,11 @@
43
43
  "typecheck": "tsc --noEmit"
44
44
  },
45
45
  "devDependencies": {
46
- "@nxgt/mail": "0.3.0",
46
+ "@nxgt/mail": "0.4.0",
47
47
  "@types/bun": "^1.4.2"
48
48
  },
49
49
  "peerDependencies": {
50
- "@nxgt/mail": "^0.3.0",
50
+ "@nxgt/mail": "^0.4.0",
51
51
  "typescript": "^6.0.3"
52
52
  }
53
53
  }