@sendery/sdk 0.1.8 → 0.1.9
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 +4 -2
- package/dist/index.d.ts +2 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -153,14 +153,16 @@ Learn how to [retry emails without duplicate sends](https://sendery.co/en/docs/i
|
|
|
153
153
|
|
|
154
154
|
Send events such as account signups or orders from your app. Your team can use them to automate emails in Sendery, choosing the content, recipients, and timing. Available on all plans.
|
|
155
155
|
|
|
156
|
-
Start with [Connecting your application](https://sendery.co/en/docs/connect-events) to define the data Sendery can expect, then [send events](https://sendery.co/en/docs/send-events) as they happen.
|
|
156
|
+
Start with [Connecting your application](https://sendery.co/en/docs/connect-events) to define the data Sendery can expect, then [send events](https://sendery.co/en/docs/send-events) as they happen. Define at least one email address field and include an address when sending events.
|
|
157
157
|
|
|
158
158
|
```typescript
|
|
159
159
|
const receipt = await sendery.event({
|
|
160
|
-
name: "account.created",
|
|
160
|
+
name: "account.created", language: "en",
|
|
161
161
|
object: { type: "account", id: "842" },
|
|
162
162
|
data: { email: "steven@example.com", name: "Steven" },
|
|
163
163
|
}).retry().send();
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
+
`language` selects a published template translation; omit it to use the template’s default.
|
|
167
|
+
|
|
166
168
|
Retries reuse the same event data and idempotency key. To retry across jobs or process restarts, supply and persist your own key. A successful response confirms that Sendery accepted the event. [Learn what you can automate with workflows](https://sendery.co/en/docs/build-workflow).
|
package/dist/index.d.ts
CHANGED
|
@@ -13,12 +13,7 @@ export interface EventDefinition {
|
|
|
13
13
|
label: string;
|
|
14
14
|
};
|
|
15
15
|
fields: Record<string, EventField>;
|
|
16
|
-
|
|
17
|
-
label: string;
|
|
18
|
-
email: string;
|
|
19
|
-
name?: string;
|
|
20
|
-
locale?: string;
|
|
21
|
-
}>;
|
|
16
|
+
description?: string;
|
|
22
17
|
}
|
|
23
18
|
export interface EventType extends EventDefinition {
|
|
24
19
|
name: string;
|
|
@@ -74,6 +69,7 @@ export interface EventInput {
|
|
|
74
69
|
id: string;
|
|
75
70
|
};
|
|
76
71
|
correlation_id?: string;
|
|
72
|
+
language?: string;
|
|
77
73
|
data: Record<string, unknown>;
|
|
78
74
|
}
|
|
79
75
|
export interface EventReceipt extends SendReceipt {
|