@sendery/sdk 0.1.6 → 0.1.7
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/CHANGELOG.md +4 -0
- package/README.md +9 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -36,9 +36,9 @@ if (!apiKey) throw new Error('Set SENDERY_API_KEY on your server.');
|
|
|
36
36
|
|
|
37
37
|
const sendery = new Sendery(apiKey);
|
|
38
38
|
const receipt = await sendery.send({
|
|
39
|
-
to: '
|
|
39
|
+
to: 'steven@example.com',
|
|
40
40
|
template: 'your-template',
|
|
41
|
-
data: { name: '
|
|
41
|
+
data: { name: 'Steven', action_url: 'https://example.com/start' },
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
console.log(receipt.id);
|
|
@@ -50,9 +50,9 @@ Choose a [published template version](https://sendery.co/en/docs/send-email#sect
|
|
|
50
50
|
|
|
51
51
|
```javascript
|
|
52
52
|
const receipt = await sendery.prepare({
|
|
53
|
-
to: '
|
|
53
|
+
to: 'steven@example.com',
|
|
54
54
|
template: 'your-template',
|
|
55
|
-
data: { name: '
|
|
55
|
+
data: { name: 'Steven', action_url: 'https://example.com/start' },
|
|
56
56
|
}).version(3).send();
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -70,9 +70,9 @@ const sendery = new Sendery(process.env.SENDERY_API_KEY);
|
|
|
70
70
|
const file = await readFile('/path/document.pdf');
|
|
71
71
|
|
|
72
72
|
await sendery.prepare({
|
|
73
|
-
to: '
|
|
73
|
+
to: 'steven@example.com',
|
|
74
74
|
template: 'your-template',
|
|
75
|
-
data: { name: '
|
|
75
|
+
data: { name: 'Steven', action_url: 'https://example.com/start' },
|
|
76
76
|
attachments: [attachment('document.pdf', file, 'application/pdf')],
|
|
77
77
|
}, 'your-idempotency-key').retry().send();
|
|
78
78
|
```
|
|
@@ -94,9 +94,9 @@ Use `retry(3)` for up to three extra attempts after temporary failures. Keep the
|
|
|
94
94
|
|
|
95
95
|
```javascript
|
|
96
96
|
const email = sendery.prepare({
|
|
97
|
-
to: '
|
|
97
|
+
to: 'steven@example.com',
|
|
98
98
|
template: 'your-template',
|
|
99
|
-
data: { name: '
|
|
99
|
+
data: { name: 'Steven', action_url: 'https://example.com/start' },
|
|
100
100
|
}, 'your-idempotency-key');
|
|
101
101
|
|
|
102
102
|
const receipt = await email.retry(3).send();
|
|
@@ -143,7 +143,7 @@ Start with [Connecting your application](https://sendery.co/en/docs/connect-even
|
|
|
143
143
|
const receipt = await sendery.event({
|
|
144
144
|
name: "account.created",
|
|
145
145
|
object: { type: "account", id: "842" },
|
|
146
|
-
data: { email: "
|
|
146
|
+
data: { email: "steven@example.com", name: "Steven" },
|
|
147
147
|
}).retry().send();
|
|
148
148
|
```
|
|
149
149
|
|