@trycourier/courier 3.9.0 → 3.10.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/CHANGELOG.md +3 -0
- package/README.md +23 -0
- package/lib/send/types.d.ts +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased][unreleased]
|
|
7
7
|
|
|
8
|
+
## [3.10.0] - 2022-03-20
|
|
9
|
+
- adds support for messages timeout (`message.timeout`)
|
|
10
|
+
|
|
8
11
|
## [3.9.0] - 2022-03-17
|
|
9
12
|
|
|
10
13
|
- adds support for bulk messaging API v2 support
|
package/README.md
CHANGED
|
@@ -160,6 +160,29 @@ const { requestId } = await courier.send({
|
|
|
160
160
|
},
|
|
161
161
|
},
|
|
162
162
|
});
|
|
163
|
+
|
|
164
|
+
// Example: send a basic message that expires after the specified timeout
|
|
165
|
+
const { requestId } = await courier.send({
|
|
166
|
+
message: {
|
|
167
|
+
to: {
|
|
168
|
+
data: {
|
|
169
|
+
name: "Marty",
|
|
170
|
+
},
|
|
171
|
+
email: "marty_mcfly@email.com",
|
|
172
|
+
},
|
|
173
|
+
content: {
|
|
174
|
+
title: "Back to the Future",
|
|
175
|
+
body: "Oh my {{name}}, we need 1.21 Gigawatts!",
|
|
176
|
+
},
|
|
177
|
+
routing: {
|
|
178
|
+
method: "single",
|
|
179
|
+
channels: ["email"],
|
|
180
|
+
},
|
|
181
|
+
timeout: {
|
|
182
|
+
message: 3600000 // 1 hour in milliseconds
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
});
|
|
163
186
|
```
|
|
164
187
|
|
|
165
188
|
## Environment Variables
|
package/lib/send/types.d.ts
CHANGED
|
@@ -236,13 +236,22 @@ export interface ElementalContentSugar {
|
|
|
236
236
|
body?: string;
|
|
237
237
|
title?: string;
|
|
238
238
|
}
|
|
239
|
+
export interface Timeout {
|
|
240
|
+
provider?: number;
|
|
241
|
+
channel?: number;
|
|
242
|
+
message?: number;
|
|
243
|
+
escalation?: number;
|
|
244
|
+
criteria?: "no-escalation" | "delivered" | "viewed" | "engaged";
|
|
245
|
+
}
|
|
239
246
|
export declare type Content = ElementalContentSugar | ElementalContent;
|
|
240
247
|
export interface BaseMessage {
|
|
248
|
+
brand_id?: string;
|
|
241
249
|
channels?: MessageChannels;
|
|
242
250
|
data?: MessageData;
|
|
243
251
|
metadata?: MessageMetadata;
|
|
244
252
|
providers?: MessageProviders;
|
|
245
253
|
routing?: Routing;
|
|
254
|
+
timeout?: Timeout;
|
|
246
255
|
to: MessageRecipient;
|
|
247
256
|
}
|
|
248
257
|
interface TrackingOverride {
|