ark-email 0.7.0 → 0.9.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +22 -6
- data/lib/ark_email/models/email_send_batch_params.rb +10 -1
- data/lib/ark_email/models/email_send_batch_response.rb +13 -1
- data/lib/ark_email/models/email_send_params.rb +14 -2
- data/lib/ark_email/models/email_send_raw_response.rb +13 -1
- data/lib/ark_email/models/email_send_response.rb +13 -1
- data/lib/ark_email/models/webhook_list_deliveries_params.rb +79 -0
- data/lib/ark_email/models/webhook_list_deliveries_response.rb +154 -0
- data/lib/ark_email/models/webhook_replay_delivery_params.rb +20 -0
- data/lib/ark_email/models/webhook_replay_delivery_response.rb +82 -0
- data/lib/ark_email/models/webhook_retrieve_delivery_params.rb +20 -0
- data/lib/ark_email/models/webhook_retrieve_delivery_response.rb +198 -0
- data/lib/ark_email/models.rb +6 -0
- data/lib/ark_email/resources/emails.rb +1 -1
- data/lib/ark_email/resources/webhooks.rb +127 -0
- data/lib/ark_email/version.rb +1 -1
- data/lib/ark_email.rb +6 -0
- data/rbi/ark_email/models/email_send_batch_params.rbi +18 -0
- data/rbi/ark_email/models/email_send_batch_response.rbi +16 -3
- data/rbi/ark_email/models/email_send_params.rbi +26 -2
- data/rbi/ark_email/models/email_send_raw_response.rbi +16 -3
- data/rbi/ark_email/models/email_send_response.rbi +16 -3
- data/rbi/ark_email/models/webhook_list_deliveries_params.rbi +172 -0
- data/rbi/ark_email/models/webhook_list_deliveries_response.rbi +257 -0
- data/rbi/ark_email/models/webhook_replay_delivery_params.rbi +38 -0
- data/rbi/ark_email/models/webhook_replay_delivery_response.rbi +132 -0
- data/rbi/ark_email/models/webhook_retrieve_delivery_params.rbi +38 -0
- data/rbi/ark_email/models/webhook_retrieve_delivery_response.rbi +371 -0
- data/rbi/ark_email/models.rbi +7 -0
- data/rbi/ark_email/resources/emails.rbi +14 -1
- data/rbi/ark_email/resources/webhooks.rbi +105 -0
- data/sig/ark_email/models/email_send_batch_response.rbs +10 -3
- data/sig/ark_email/models/email_send_raw_response.rbs +10 -3
- data/sig/ark_email/models/email_send_response.rbs +10 -3
- data/sig/ark_email/models/webhook_list_deliveries_params.rbs +90 -0
- data/sig/ark_email/models/webhook_list_deliveries_response.rbs +127 -0
- data/sig/ark_email/models/webhook_replay_delivery_params.rbs +23 -0
- data/sig/ark_email/models/webhook_replay_delivery_response.rbs +72 -0
- data/sig/ark_email/models/webhook_retrieve_delivery_params.rbs +23 -0
- data/sig/ark_email/models/webhook_retrieve_delivery_response.rbs +158 -0
- data/sig/ark_email/models.rbs +6 -0
- data/sig/ark_email/resources/webhooks.rbs +23 -0
- metadata +20 -2
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ArkEmail
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookRetrieveDeliveryResponse < ArkEmail::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse,
|
|
10
|
+
ArkEmail::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Full details of a webhook delivery including request and response
|
|
15
|
+
sig { returns(ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data) }
|
|
16
|
+
attr_reader :data
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
data: ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::OrHash
|
|
21
|
+
).void
|
|
22
|
+
end
|
|
23
|
+
attr_writer :data
|
|
24
|
+
|
|
25
|
+
sig { returns(ArkEmail::APIMeta) }
|
|
26
|
+
attr_reader :meta
|
|
27
|
+
|
|
28
|
+
sig { params(meta: ArkEmail::APIMeta::OrHash).void }
|
|
29
|
+
attr_writer :meta
|
|
30
|
+
|
|
31
|
+
sig { returns(T::Boolean) }
|
|
32
|
+
attr_accessor :success
|
|
33
|
+
|
|
34
|
+
# Detailed information about a webhook delivery attempt
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
data: ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::OrHash,
|
|
38
|
+
meta: ArkEmail::APIMeta::OrHash,
|
|
39
|
+
success: T::Boolean
|
|
40
|
+
).returns(T.attached_class)
|
|
41
|
+
end
|
|
42
|
+
def self.new(
|
|
43
|
+
# Full details of a webhook delivery including request and response
|
|
44
|
+
data:,
|
|
45
|
+
meta:,
|
|
46
|
+
success: true
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
override.returns(
|
|
52
|
+
{
|
|
53
|
+
data: ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data,
|
|
54
|
+
meta: ArkEmail::APIMeta,
|
|
55
|
+
success: T::Boolean
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
def to_hash
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
class Data < ArkEmail::Internal::Type::BaseModel
|
|
63
|
+
OrHash =
|
|
64
|
+
T.type_alias do
|
|
65
|
+
T.any(
|
|
66
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data,
|
|
67
|
+
ArkEmail::Internal::AnyHash
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Unique delivery ID (UUID)
|
|
72
|
+
sig { returns(String) }
|
|
73
|
+
attr_accessor :id
|
|
74
|
+
|
|
75
|
+
# Attempt number for this delivery
|
|
76
|
+
sig { returns(Integer) }
|
|
77
|
+
attr_accessor :attempt
|
|
78
|
+
|
|
79
|
+
# Event type that triggered this delivery
|
|
80
|
+
sig do
|
|
81
|
+
returns(
|
|
82
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
attr_accessor :event
|
|
86
|
+
|
|
87
|
+
# The request that was sent to your endpoint
|
|
88
|
+
sig do
|
|
89
|
+
returns(
|
|
90
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
attr_reader :request
|
|
94
|
+
|
|
95
|
+
sig do
|
|
96
|
+
params(
|
|
97
|
+
request:
|
|
98
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request::OrHash
|
|
99
|
+
).void
|
|
100
|
+
end
|
|
101
|
+
attr_writer :request
|
|
102
|
+
|
|
103
|
+
# The response received from your endpoint
|
|
104
|
+
sig do
|
|
105
|
+
returns(
|
|
106
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
attr_reader :response
|
|
110
|
+
|
|
111
|
+
sig do
|
|
112
|
+
params(
|
|
113
|
+
response:
|
|
114
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response::OrHash
|
|
115
|
+
).void
|
|
116
|
+
end
|
|
117
|
+
attr_writer :response
|
|
118
|
+
|
|
119
|
+
# HTTP status code returned by the endpoint
|
|
120
|
+
sig { returns(T.nilable(Integer)) }
|
|
121
|
+
attr_accessor :status_code
|
|
122
|
+
|
|
123
|
+
# Whether the delivery was successful (2xx response)
|
|
124
|
+
sig { returns(T::Boolean) }
|
|
125
|
+
attr_accessor :success
|
|
126
|
+
|
|
127
|
+
# When this delivery attempt occurred
|
|
128
|
+
sig { returns(Time) }
|
|
129
|
+
attr_accessor :timestamp
|
|
130
|
+
|
|
131
|
+
# URL the webhook was delivered to
|
|
132
|
+
sig { returns(String) }
|
|
133
|
+
attr_accessor :url
|
|
134
|
+
|
|
135
|
+
# ID of the webhook this delivery belongs to
|
|
136
|
+
sig { returns(String) }
|
|
137
|
+
attr_accessor :webhook_id
|
|
138
|
+
|
|
139
|
+
# Name of the webhook for easy identification
|
|
140
|
+
sig { returns(String) }
|
|
141
|
+
attr_accessor :webhook_name
|
|
142
|
+
|
|
143
|
+
# Whether this delivery will be retried
|
|
144
|
+
sig { returns(T::Boolean) }
|
|
145
|
+
attr_accessor :will_retry
|
|
146
|
+
|
|
147
|
+
# Full details of a webhook delivery including request and response
|
|
148
|
+
sig do
|
|
149
|
+
params(
|
|
150
|
+
id: String,
|
|
151
|
+
attempt: Integer,
|
|
152
|
+
event:
|
|
153
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::OrSymbol,
|
|
154
|
+
request:
|
|
155
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request::OrHash,
|
|
156
|
+
response:
|
|
157
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response::OrHash,
|
|
158
|
+
status_code: T.nilable(Integer),
|
|
159
|
+
success: T::Boolean,
|
|
160
|
+
timestamp: Time,
|
|
161
|
+
url: String,
|
|
162
|
+
webhook_id: String,
|
|
163
|
+
webhook_name: String,
|
|
164
|
+
will_retry: T::Boolean
|
|
165
|
+
).returns(T.attached_class)
|
|
166
|
+
end
|
|
167
|
+
def self.new(
|
|
168
|
+
# Unique delivery ID (UUID)
|
|
169
|
+
id:,
|
|
170
|
+
# Attempt number for this delivery
|
|
171
|
+
attempt:,
|
|
172
|
+
# Event type that triggered this delivery
|
|
173
|
+
event:,
|
|
174
|
+
# The request that was sent to your endpoint
|
|
175
|
+
request:,
|
|
176
|
+
# The response received from your endpoint
|
|
177
|
+
response:,
|
|
178
|
+
# HTTP status code returned by the endpoint
|
|
179
|
+
status_code:,
|
|
180
|
+
# Whether the delivery was successful (2xx response)
|
|
181
|
+
success:,
|
|
182
|
+
# When this delivery attempt occurred
|
|
183
|
+
timestamp:,
|
|
184
|
+
# URL the webhook was delivered to
|
|
185
|
+
url:,
|
|
186
|
+
# ID of the webhook this delivery belongs to
|
|
187
|
+
webhook_id:,
|
|
188
|
+
# Name of the webhook for easy identification
|
|
189
|
+
webhook_name:,
|
|
190
|
+
# Whether this delivery will be retried
|
|
191
|
+
will_retry:
|
|
192
|
+
)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
sig do
|
|
196
|
+
override.returns(
|
|
197
|
+
{
|
|
198
|
+
id: String,
|
|
199
|
+
attempt: Integer,
|
|
200
|
+
event:
|
|
201
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol,
|
|
202
|
+
request:
|
|
203
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request,
|
|
204
|
+
response:
|
|
205
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response,
|
|
206
|
+
status_code: T.nilable(Integer),
|
|
207
|
+
success: T::Boolean,
|
|
208
|
+
timestamp: Time,
|
|
209
|
+
url: String,
|
|
210
|
+
webhook_id: String,
|
|
211
|
+
webhook_name: String,
|
|
212
|
+
will_retry: T::Boolean
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
end
|
|
216
|
+
def to_hash
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Event type that triggered this delivery
|
|
220
|
+
module Event
|
|
221
|
+
extend ArkEmail::Internal::Type::Enum
|
|
222
|
+
|
|
223
|
+
TaggedSymbol =
|
|
224
|
+
T.type_alias do
|
|
225
|
+
T.all(
|
|
226
|
+
Symbol,
|
|
227
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event
|
|
228
|
+
)
|
|
229
|
+
end
|
|
230
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
231
|
+
|
|
232
|
+
MESSAGE_SENT =
|
|
233
|
+
T.let(
|
|
234
|
+
:MessageSent,
|
|
235
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
236
|
+
)
|
|
237
|
+
MESSAGE_DELAYED =
|
|
238
|
+
T.let(
|
|
239
|
+
:MessageDelayed,
|
|
240
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
241
|
+
)
|
|
242
|
+
MESSAGE_DELIVERY_FAILED =
|
|
243
|
+
T.let(
|
|
244
|
+
:MessageDeliveryFailed,
|
|
245
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
246
|
+
)
|
|
247
|
+
MESSAGE_HELD =
|
|
248
|
+
T.let(
|
|
249
|
+
:MessageHeld,
|
|
250
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
251
|
+
)
|
|
252
|
+
MESSAGE_BOUNCED =
|
|
253
|
+
T.let(
|
|
254
|
+
:MessageBounced,
|
|
255
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
256
|
+
)
|
|
257
|
+
MESSAGE_LINK_CLICKED =
|
|
258
|
+
T.let(
|
|
259
|
+
:MessageLinkClicked,
|
|
260
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
261
|
+
)
|
|
262
|
+
MESSAGE_LOADED =
|
|
263
|
+
T.let(
|
|
264
|
+
:MessageLoaded,
|
|
265
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
266
|
+
)
|
|
267
|
+
DOMAIN_DNS_ERROR =
|
|
268
|
+
T.let(
|
|
269
|
+
:DomainDNSError,
|
|
270
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
sig do
|
|
274
|
+
override.returns(
|
|
275
|
+
T::Array[
|
|
276
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event::TaggedSymbol
|
|
277
|
+
]
|
|
278
|
+
)
|
|
279
|
+
end
|
|
280
|
+
def self.values
|
|
281
|
+
end
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
class Request < ArkEmail::Internal::Type::BaseModel
|
|
285
|
+
OrHash =
|
|
286
|
+
T.type_alias do
|
|
287
|
+
T.any(
|
|
288
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request,
|
|
289
|
+
ArkEmail::Internal::AnyHash
|
|
290
|
+
)
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# HTTP headers that were sent with the request
|
|
294
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
295
|
+
attr_accessor :headers
|
|
296
|
+
|
|
297
|
+
# The complete webhook payload that was sent
|
|
298
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
299
|
+
attr_accessor :payload
|
|
300
|
+
|
|
301
|
+
# The request that was sent to your endpoint
|
|
302
|
+
sig do
|
|
303
|
+
params(
|
|
304
|
+
headers: T::Hash[Symbol, String],
|
|
305
|
+
payload: T::Hash[Symbol, T.anything]
|
|
306
|
+
).returns(T.attached_class)
|
|
307
|
+
end
|
|
308
|
+
def self.new(
|
|
309
|
+
# HTTP headers that were sent with the request
|
|
310
|
+
headers:,
|
|
311
|
+
# The complete webhook payload that was sent
|
|
312
|
+
payload:
|
|
313
|
+
)
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
sig do
|
|
317
|
+
override.returns(
|
|
318
|
+
{
|
|
319
|
+
headers: T::Hash[Symbol, String],
|
|
320
|
+
payload: T::Hash[Symbol, T.anything]
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
end
|
|
324
|
+
def to_hash
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
class Response < ArkEmail::Internal::Type::BaseModel
|
|
329
|
+
OrHash =
|
|
330
|
+
T.type_alias do
|
|
331
|
+
T.any(
|
|
332
|
+
ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response,
|
|
333
|
+
ArkEmail::Internal::AnyHash
|
|
334
|
+
)
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# HTTP status code from your endpoint
|
|
338
|
+
sig { returns(T.nilable(Integer)) }
|
|
339
|
+
attr_accessor :status_code
|
|
340
|
+
|
|
341
|
+
# Response body from your endpoint (may be truncated)
|
|
342
|
+
sig { returns(T.nilable(String)) }
|
|
343
|
+
attr_accessor :body
|
|
344
|
+
|
|
345
|
+
# The response received from your endpoint
|
|
346
|
+
sig do
|
|
347
|
+
params(
|
|
348
|
+
status_code: T.nilable(Integer),
|
|
349
|
+
body: T.nilable(String)
|
|
350
|
+
).returns(T.attached_class)
|
|
351
|
+
end
|
|
352
|
+
def self.new(
|
|
353
|
+
# HTTP status code from your endpoint
|
|
354
|
+
status_code:,
|
|
355
|
+
# Response body from your endpoint (may be truncated)
|
|
356
|
+
body: nil
|
|
357
|
+
)
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
sig do
|
|
361
|
+
override.returns(
|
|
362
|
+
{ status_code: T.nilable(Integer), body: T.nilable(String) }
|
|
363
|
+
)
|
|
364
|
+
end
|
|
365
|
+
def to_hash
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
end
|
|
371
|
+
end
|
data/rbi/ark_email/models.rbi
CHANGED
|
@@ -58,8 +58,15 @@ module ArkEmail
|
|
|
58
58
|
|
|
59
59
|
WebhookDeleteParams = ArkEmail::Models::WebhookDeleteParams
|
|
60
60
|
|
|
61
|
+
WebhookListDeliveriesParams = ArkEmail::Models::WebhookListDeliveriesParams
|
|
62
|
+
|
|
61
63
|
WebhookListParams = ArkEmail::Models::WebhookListParams
|
|
62
64
|
|
|
65
|
+
WebhookReplayDeliveryParams = ArkEmail::Models::WebhookReplayDeliveryParams
|
|
66
|
+
|
|
67
|
+
WebhookRetrieveDeliveryParams =
|
|
68
|
+
ArkEmail::Models::WebhookRetrieveDeliveryParams
|
|
69
|
+
|
|
63
70
|
WebhookRetrieveParams = ArkEmail::Models::WebhookRetrieveParams
|
|
64
71
|
|
|
65
72
|
WebhookTestParams = ArkEmail::Models::WebhookTestParams
|
|
@@ -141,7 +141,8 @@ module ArkEmail
|
|
|
141
141
|
).returns(ArkEmail::Models::EmailSendResponse)
|
|
142
142
|
end
|
|
143
143
|
def send_(
|
|
144
|
-
# Body param: Sender email address. Must be from a verified domain
|
|
144
|
+
# Body param: Sender email address. Must be from a verified domain OR use sandbox
|
|
145
|
+
# mode.
|
|
145
146
|
#
|
|
146
147
|
# **Supported formats:**
|
|
147
148
|
#
|
|
@@ -150,6 +151,10 @@ module ArkEmail
|
|
|
150
151
|
# - With quoted name: `"Acme Support" <support@yourdomain.com>`
|
|
151
152
|
#
|
|
152
153
|
# The domain portion must match a verified sending domain in your account.
|
|
154
|
+
#
|
|
155
|
+
# **Sandbox mode:** Use `sandbox@arkhq.io` to send test emails without domain
|
|
156
|
+
# verification. Sandbox emails can only be sent to organization members and are
|
|
157
|
+
# limited to 10 per day.
|
|
153
158
|
from:,
|
|
154
159
|
# Body param: Email subject line
|
|
155
160
|
subject:,
|
|
@@ -176,6 +181,14 @@ module ArkEmail
|
|
|
176
181
|
#
|
|
177
182
|
# This is useful for correlating webhook events with your internal systems (e.g.,
|
|
178
183
|
# user IDs, order IDs, campaign identifiers).
|
|
184
|
+
#
|
|
185
|
+
# **Validation Rules:**
|
|
186
|
+
#
|
|
187
|
+
# - Maximum 10 keys per email
|
|
188
|
+
# - Keys: 1-40 characters, must start with a letter, only alphanumeric and
|
|
189
|
+
# underscores (`^[a-zA-Z][a-zA-Z0-9_]*$`)
|
|
190
|
+
# - Values: 1-500 characters, no control characters (newlines, tabs, etc.)
|
|
191
|
+
# - Total size: 4KB maximum (JSON-encoded)
|
|
179
192
|
metadata: nil,
|
|
180
193
|
# Body param: Reply-to address (accepts null)
|
|
181
194
|
reply_to: nil,
|
|
@@ -102,6 +102,111 @@ module ArkEmail
|
|
|
102
102
|
def delete(webhook_id, request_options: {})
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
+
# Get a paginated list of delivery attempts for a specific webhook.
|
|
106
|
+
#
|
|
107
|
+
# Use this to:
|
|
108
|
+
#
|
|
109
|
+
# - Monitor webhook health and delivery success rate
|
|
110
|
+
# - Debug failed deliveries
|
|
111
|
+
# - Find specific events to replay
|
|
112
|
+
#
|
|
113
|
+
# **Filtering:**
|
|
114
|
+
#
|
|
115
|
+
# - Filter by success/failure to find problematic deliveries
|
|
116
|
+
# - Filter by event type to find specific events
|
|
117
|
+
# - Filter by time range for debugging recent issues
|
|
118
|
+
#
|
|
119
|
+
# **Retry behavior:** Failed deliveries are automatically retried with exponential
|
|
120
|
+
# backoff over ~3 days. Check `willRetry` to see if more attempts are scheduled.
|
|
121
|
+
sig do
|
|
122
|
+
params(
|
|
123
|
+
webhook_id: String,
|
|
124
|
+
after: Integer,
|
|
125
|
+
before: Integer,
|
|
126
|
+
event: ArkEmail::WebhookListDeliveriesParams::Event::OrSymbol,
|
|
127
|
+
page: Integer,
|
|
128
|
+
per_page: Integer,
|
|
129
|
+
success: T::Boolean,
|
|
130
|
+
request_options: ArkEmail::RequestOptions::OrHash
|
|
131
|
+
).returns(ArkEmail::Models::WebhookListDeliveriesResponse)
|
|
132
|
+
end
|
|
133
|
+
def list_deliveries(
|
|
134
|
+
# Webhook ID or UUID
|
|
135
|
+
webhook_id,
|
|
136
|
+
# Only deliveries after this Unix timestamp
|
|
137
|
+
after: nil,
|
|
138
|
+
# Only deliveries before this Unix timestamp
|
|
139
|
+
before: nil,
|
|
140
|
+
# Filter by event type
|
|
141
|
+
event: nil,
|
|
142
|
+
# Page number (default 1)
|
|
143
|
+
page: nil,
|
|
144
|
+
# Items per page (default 30, max 100)
|
|
145
|
+
per_page: nil,
|
|
146
|
+
# Filter by delivery success (true = 2xx response, false = non-2xx or error)
|
|
147
|
+
success: nil,
|
|
148
|
+
request_options: {}
|
|
149
|
+
)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Re-send a webhook delivery to your endpoint.
|
|
153
|
+
#
|
|
154
|
+
# **Use cases:**
|
|
155
|
+
#
|
|
156
|
+
# - Recover from transient failures after fixing your endpoint
|
|
157
|
+
# - Test endpoint changes with real historical data
|
|
158
|
+
# - Retry deliveries that failed due to downtime
|
|
159
|
+
#
|
|
160
|
+
# **How it works:**
|
|
161
|
+
#
|
|
162
|
+
# 1. Fetches the original payload from the delivery
|
|
163
|
+
# 2. Generates a new timestamp and signature
|
|
164
|
+
# 3. Sends to your webhook URL immediately
|
|
165
|
+
# 4. Returns the result (does not queue for retry if it fails)
|
|
166
|
+
#
|
|
167
|
+
# **Note:** The webhook must be enabled to replay deliveries.
|
|
168
|
+
sig do
|
|
169
|
+
params(
|
|
170
|
+
delivery_id: String,
|
|
171
|
+
webhook_id: String,
|
|
172
|
+
request_options: ArkEmail::RequestOptions::OrHash
|
|
173
|
+
).returns(ArkEmail::Models::WebhookReplayDeliveryResponse)
|
|
174
|
+
end
|
|
175
|
+
def replay_delivery(
|
|
176
|
+
# Delivery ID (UUID) to replay
|
|
177
|
+
delivery_id,
|
|
178
|
+
# Webhook ID or UUID
|
|
179
|
+
webhook_id:,
|
|
180
|
+
request_options: {}
|
|
181
|
+
)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Get detailed information about a specific webhook delivery attempt.
|
|
185
|
+
#
|
|
186
|
+
# Returns:
|
|
187
|
+
#
|
|
188
|
+
# - The complete request payload that was sent
|
|
189
|
+
# - Request headers including the signature
|
|
190
|
+
# - Response status code and body from your endpoint
|
|
191
|
+
# - Timing information
|
|
192
|
+
#
|
|
193
|
+
# Use this to debug why a delivery failed or verify what data was sent.
|
|
194
|
+
sig do
|
|
195
|
+
params(
|
|
196
|
+
delivery_id: String,
|
|
197
|
+
webhook_id: String,
|
|
198
|
+
request_options: ArkEmail::RequestOptions::OrHash
|
|
199
|
+
).returns(ArkEmail::Models::WebhookRetrieveDeliveryResponse)
|
|
200
|
+
end
|
|
201
|
+
def retrieve_delivery(
|
|
202
|
+
# Delivery ID (UUID)
|
|
203
|
+
delivery_id,
|
|
204
|
+
# Webhook ID or UUID
|
|
205
|
+
webhook_id:,
|
|
206
|
+
request_options: {}
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
|
|
105
210
|
# Send a test payload to your webhook endpoint and verify it receives the data
|
|
106
211
|
# correctly.
|
|
107
212
|
#
|
|
@@ -31,7 +31,8 @@ module ArkEmail
|
|
|
31
31
|
accepted: Integer,
|
|
32
32
|
failed: Integer,
|
|
33
33
|
messages: ::Hash[Symbol, ArkEmail::Models::EmailSendBatchResponse::Data::Message],
|
|
34
|
-
total: Integer
|
|
34
|
+
total: Integer,
|
|
35
|
+
sandbox: bool
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
class Data < ArkEmail::Internal::Type::BaseModel
|
|
@@ -43,18 +44,24 @@ module ArkEmail
|
|
|
43
44
|
|
|
44
45
|
attr_accessor total: Integer
|
|
45
46
|
|
|
47
|
+
attr_reader sandbox: bool?
|
|
48
|
+
|
|
49
|
+
def sandbox=: (bool) -> bool
|
|
50
|
+
|
|
46
51
|
def initialize: (
|
|
47
52
|
accepted: Integer,
|
|
48
53
|
failed: Integer,
|
|
49
54
|
messages: ::Hash[Symbol, ArkEmail::Models::EmailSendBatchResponse::Data::Message],
|
|
50
|
-
total: Integer
|
|
55
|
+
total: Integer,
|
|
56
|
+
?sandbox: bool
|
|
51
57
|
) -> void
|
|
52
58
|
|
|
53
59
|
def to_hash: -> {
|
|
54
60
|
accepted: Integer,
|
|
55
61
|
failed: Integer,
|
|
56
62
|
messages: ::Hash[Symbol, ArkEmail::Models::EmailSendBatchResponse::Data::Message],
|
|
57
|
-
total: Integer
|
|
63
|
+
total: Integer,
|
|
64
|
+
sandbox: bool
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
type message = { id: String, token: String }
|
|
@@ -31,7 +31,8 @@ module ArkEmail
|
|
|
31
31
|
id: String,
|
|
32
32
|
status: ArkEmail::Models::EmailSendRawResponse::Data::status,
|
|
33
33
|
to: ::Array[String],
|
|
34
|
-
message_id: String
|
|
34
|
+
message_id: String,
|
|
35
|
+
sandbox: bool
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
class Data < ArkEmail::Internal::Type::BaseModel
|
|
@@ -45,18 +46,24 @@ module ArkEmail
|
|
|
45
46
|
|
|
46
47
|
def message_id=: (String) -> String
|
|
47
48
|
|
|
49
|
+
attr_reader sandbox: bool?
|
|
50
|
+
|
|
51
|
+
def sandbox=: (bool) -> bool
|
|
52
|
+
|
|
48
53
|
def initialize: (
|
|
49
54
|
id: String,
|
|
50
55
|
status: ArkEmail::Models::EmailSendRawResponse::Data::status,
|
|
51
56
|
to: ::Array[String],
|
|
52
|
-
?message_id: String
|
|
57
|
+
?message_id: String,
|
|
58
|
+
?sandbox: bool
|
|
53
59
|
) -> void
|
|
54
60
|
|
|
55
61
|
def to_hash: -> {
|
|
56
62
|
id: String,
|
|
57
63
|
status: ArkEmail::Models::EmailSendRawResponse::Data::status,
|
|
58
64
|
to: ::Array[String],
|
|
59
|
-
message_id: String
|
|
65
|
+
message_id: String,
|
|
66
|
+
sandbox: bool
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
type status = :pending | :sent
|
|
@@ -31,7 +31,8 @@ module ArkEmail
|
|
|
31
31
|
id: String,
|
|
32
32
|
status: ArkEmail::Models::EmailSendResponse::Data::status,
|
|
33
33
|
to: ::Array[String],
|
|
34
|
-
message_id: String
|
|
34
|
+
message_id: String,
|
|
35
|
+
sandbox: bool
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
class Data < ArkEmail::Internal::Type::BaseModel
|
|
@@ -45,18 +46,24 @@ module ArkEmail
|
|
|
45
46
|
|
|
46
47
|
def message_id=: (String) -> String
|
|
47
48
|
|
|
49
|
+
attr_reader sandbox: bool?
|
|
50
|
+
|
|
51
|
+
def sandbox=: (bool) -> bool
|
|
52
|
+
|
|
48
53
|
def initialize: (
|
|
49
54
|
id: String,
|
|
50
55
|
status: ArkEmail::Models::EmailSendResponse::Data::status,
|
|
51
56
|
to: ::Array[String],
|
|
52
|
-
?message_id: String
|
|
57
|
+
?message_id: String,
|
|
58
|
+
?sandbox: bool
|
|
53
59
|
) -> void
|
|
54
60
|
|
|
55
61
|
def to_hash: -> {
|
|
56
62
|
id: String,
|
|
57
63
|
status: ArkEmail::Models::EmailSendResponse::Data::status,
|
|
58
64
|
to: ::Array[String],
|
|
59
|
-
message_id: String
|
|
65
|
+
message_id: String,
|
|
66
|
+
sandbox: bool
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
type status = :pending | :sent
|