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,198 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ArkEmail
|
|
4
|
+
module Models
|
|
5
|
+
# @see ArkEmail::Resources::Webhooks#retrieve_delivery
|
|
6
|
+
class WebhookRetrieveDeliveryResponse < ArkEmail::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute data
|
|
8
|
+
# Full details of a webhook delivery including request and response
|
|
9
|
+
#
|
|
10
|
+
# @return [ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data]
|
|
11
|
+
required :data, -> { ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data }
|
|
12
|
+
|
|
13
|
+
# @!attribute meta
|
|
14
|
+
#
|
|
15
|
+
# @return [ArkEmail::Models::APIMeta]
|
|
16
|
+
required :meta, -> { ArkEmail::APIMeta }
|
|
17
|
+
|
|
18
|
+
# @!attribute success
|
|
19
|
+
#
|
|
20
|
+
# @return [Boolean, true]
|
|
21
|
+
required :success, const: true
|
|
22
|
+
|
|
23
|
+
# @!method initialize(data:, meta:, success: true)
|
|
24
|
+
# Detailed information about a webhook delivery attempt
|
|
25
|
+
#
|
|
26
|
+
# @param data [ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data] Full details of a webhook delivery including request and response
|
|
27
|
+
#
|
|
28
|
+
# @param meta [ArkEmail::Models::APIMeta]
|
|
29
|
+
#
|
|
30
|
+
# @param success [Boolean, true]
|
|
31
|
+
|
|
32
|
+
# @see ArkEmail::Models::WebhookRetrieveDeliveryResponse#data
|
|
33
|
+
class Data < ArkEmail::Internal::Type::BaseModel
|
|
34
|
+
# @!attribute id
|
|
35
|
+
# Unique delivery ID (UUID)
|
|
36
|
+
#
|
|
37
|
+
# @return [String]
|
|
38
|
+
required :id, String
|
|
39
|
+
|
|
40
|
+
# @!attribute attempt
|
|
41
|
+
# Attempt number for this delivery
|
|
42
|
+
#
|
|
43
|
+
# @return [Integer]
|
|
44
|
+
required :attempt, Integer
|
|
45
|
+
|
|
46
|
+
# @!attribute event
|
|
47
|
+
# Event type that triggered this delivery
|
|
48
|
+
#
|
|
49
|
+
# @return [Symbol, ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event]
|
|
50
|
+
required :event, enum: -> { ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event }
|
|
51
|
+
|
|
52
|
+
# @!attribute request
|
|
53
|
+
# The request that was sent to your endpoint
|
|
54
|
+
#
|
|
55
|
+
# @return [ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request]
|
|
56
|
+
required :request, -> { ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request }
|
|
57
|
+
|
|
58
|
+
# @!attribute response
|
|
59
|
+
# The response received from your endpoint
|
|
60
|
+
#
|
|
61
|
+
# @return [ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response]
|
|
62
|
+
required :response, -> { ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response }
|
|
63
|
+
|
|
64
|
+
# @!attribute status_code
|
|
65
|
+
# HTTP status code returned by the endpoint
|
|
66
|
+
#
|
|
67
|
+
# @return [Integer, nil]
|
|
68
|
+
required :status_code, Integer, api_name: :statusCode, nil?: true
|
|
69
|
+
|
|
70
|
+
# @!attribute success
|
|
71
|
+
# Whether the delivery was successful (2xx response)
|
|
72
|
+
#
|
|
73
|
+
# @return [Boolean]
|
|
74
|
+
required :success, ArkEmail::Internal::Type::Boolean
|
|
75
|
+
|
|
76
|
+
# @!attribute timestamp
|
|
77
|
+
# When this delivery attempt occurred
|
|
78
|
+
#
|
|
79
|
+
# @return [Time]
|
|
80
|
+
required :timestamp, Time
|
|
81
|
+
|
|
82
|
+
# @!attribute url
|
|
83
|
+
# URL the webhook was delivered to
|
|
84
|
+
#
|
|
85
|
+
# @return [String]
|
|
86
|
+
required :url, String
|
|
87
|
+
|
|
88
|
+
# @!attribute webhook_id
|
|
89
|
+
# ID of the webhook this delivery belongs to
|
|
90
|
+
#
|
|
91
|
+
# @return [String]
|
|
92
|
+
required :webhook_id, String, api_name: :webhookId
|
|
93
|
+
|
|
94
|
+
# @!attribute webhook_name
|
|
95
|
+
# Name of the webhook for easy identification
|
|
96
|
+
#
|
|
97
|
+
# @return [String]
|
|
98
|
+
required :webhook_name, String, api_name: :webhookName
|
|
99
|
+
|
|
100
|
+
# @!attribute will_retry
|
|
101
|
+
# Whether this delivery will be retried
|
|
102
|
+
#
|
|
103
|
+
# @return [Boolean]
|
|
104
|
+
required :will_retry, ArkEmail::Internal::Type::Boolean, api_name: :willRetry
|
|
105
|
+
|
|
106
|
+
# @!method initialize(id:, attempt:, event:, request:, response:, status_code:, success:, timestamp:, url:, webhook_id:, webhook_name:, will_retry:)
|
|
107
|
+
# Full details of a webhook delivery including request and response
|
|
108
|
+
#
|
|
109
|
+
# @param id [String] Unique delivery ID (UUID)
|
|
110
|
+
#
|
|
111
|
+
# @param attempt [Integer] Attempt number for this delivery
|
|
112
|
+
#
|
|
113
|
+
# @param event [Symbol, ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Event] Event type that triggered this delivery
|
|
114
|
+
#
|
|
115
|
+
# @param request [ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Request] The request that was sent to your endpoint
|
|
116
|
+
#
|
|
117
|
+
# @param response [ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data::Response] The response received from your endpoint
|
|
118
|
+
#
|
|
119
|
+
# @param status_code [Integer, nil] HTTP status code returned by the endpoint
|
|
120
|
+
#
|
|
121
|
+
# @param success [Boolean] Whether the delivery was successful (2xx response)
|
|
122
|
+
#
|
|
123
|
+
# @param timestamp [Time] When this delivery attempt occurred
|
|
124
|
+
#
|
|
125
|
+
# @param url [String] URL the webhook was delivered to
|
|
126
|
+
#
|
|
127
|
+
# @param webhook_id [String] ID of the webhook this delivery belongs to
|
|
128
|
+
#
|
|
129
|
+
# @param webhook_name [String] Name of the webhook for easy identification
|
|
130
|
+
#
|
|
131
|
+
# @param will_retry [Boolean] Whether this delivery will be retried
|
|
132
|
+
|
|
133
|
+
# Event type that triggered this delivery
|
|
134
|
+
#
|
|
135
|
+
# @see ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data#event
|
|
136
|
+
module Event
|
|
137
|
+
extend ArkEmail::Internal::Type::Enum
|
|
138
|
+
|
|
139
|
+
MESSAGE_SENT = :MessageSent
|
|
140
|
+
MESSAGE_DELAYED = :MessageDelayed
|
|
141
|
+
MESSAGE_DELIVERY_FAILED = :MessageDeliveryFailed
|
|
142
|
+
MESSAGE_HELD = :MessageHeld
|
|
143
|
+
MESSAGE_BOUNCED = :MessageBounced
|
|
144
|
+
MESSAGE_LINK_CLICKED = :MessageLinkClicked
|
|
145
|
+
MESSAGE_LOADED = :MessageLoaded
|
|
146
|
+
DOMAIN_DNS_ERROR = :DomainDNSError
|
|
147
|
+
|
|
148
|
+
# @!method self.values
|
|
149
|
+
# @return [Array<Symbol>]
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# @see ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data#request
|
|
153
|
+
class Request < ArkEmail::Internal::Type::BaseModel
|
|
154
|
+
# @!attribute headers
|
|
155
|
+
# HTTP headers that were sent with the request
|
|
156
|
+
#
|
|
157
|
+
# @return [Hash{Symbol=>String}]
|
|
158
|
+
required :headers, ArkEmail::Internal::Type::HashOf[String]
|
|
159
|
+
|
|
160
|
+
# @!attribute payload
|
|
161
|
+
# The complete webhook payload that was sent
|
|
162
|
+
#
|
|
163
|
+
# @return [Hash{Symbol=>Object}]
|
|
164
|
+
required :payload, ArkEmail::Internal::Type::HashOf[ArkEmail::Internal::Type::Unknown]
|
|
165
|
+
|
|
166
|
+
# @!method initialize(headers:, payload:)
|
|
167
|
+
# The request that was sent to your endpoint
|
|
168
|
+
#
|
|
169
|
+
# @param headers [Hash{Symbol=>String}] HTTP headers that were sent with the request
|
|
170
|
+
#
|
|
171
|
+
# @param payload [Hash{Symbol=>Object}] The complete webhook payload that was sent
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# @see ArkEmail::Models::WebhookRetrieveDeliveryResponse::Data#response
|
|
175
|
+
class Response < ArkEmail::Internal::Type::BaseModel
|
|
176
|
+
# @!attribute status_code
|
|
177
|
+
# HTTP status code from your endpoint
|
|
178
|
+
#
|
|
179
|
+
# @return [Integer, nil]
|
|
180
|
+
required :status_code, Integer, api_name: :statusCode, nil?: true
|
|
181
|
+
|
|
182
|
+
# @!attribute body
|
|
183
|
+
# Response body from your endpoint (may be truncated)
|
|
184
|
+
#
|
|
185
|
+
# @return [String, nil]
|
|
186
|
+
optional :body, String, nil?: true
|
|
187
|
+
|
|
188
|
+
# @!method initialize(status_code:, body: nil)
|
|
189
|
+
# The response received from your endpoint
|
|
190
|
+
#
|
|
191
|
+
# @param status_code [Integer, nil] HTTP status code from your endpoint
|
|
192
|
+
#
|
|
193
|
+
# @param body [String, nil] Response body from your endpoint (may be truncated)
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
data/lib/ark_email/models.rb
CHANGED
|
@@ -95,8 +95,14 @@ module ArkEmail
|
|
|
95
95
|
|
|
96
96
|
WebhookDeleteParams = ArkEmail::Models::WebhookDeleteParams
|
|
97
97
|
|
|
98
|
+
WebhookListDeliveriesParams = ArkEmail::Models::WebhookListDeliveriesParams
|
|
99
|
+
|
|
98
100
|
WebhookListParams = ArkEmail::Models::WebhookListParams
|
|
99
101
|
|
|
102
|
+
WebhookReplayDeliveryParams = ArkEmail::Models::WebhookReplayDeliveryParams
|
|
103
|
+
|
|
104
|
+
WebhookRetrieveDeliveryParams = ArkEmail::Models::WebhookRetrieveDeliveryParams
|
|
105
|
+
|
|
100
106
|
WebhookRetrieveParams = ArkEmail::Models::WebhookRetrieveParams
|
|
101
107
|
|
|
102
108
|
WebhookTestParams = ArkEmail::Models::WebhookTestParams
|
|
@@ -144,7 +144,7 @@ module ArkEmail
|
|
|
144
144
|
#
|
|
145
145
|
# @overload send_(from:, subject:, to:, attachments: nil, bcc: nil, cc: nil, headers: nil, html: nil, metadata: nil, reply_to: nil, tag: nil, text: nil, idempotency_key: nil, request_options: {})
|
|
146
146
|
#
|
|
147
|
-
# @param from [String] Body param: Sender email address. Must be from a verified domain
|
|
147
|
+
# @param from [String] Body param: Sender email address. Must be from a verified domain OR use sandbox
|
|
148
148
|
#
|
|
149
149
|
# @param subject [String] Body param: Email subject line
|
|
150
150
|
#
|
|
@@ -129,6 +129,133 @@ module ArkEmail
|
|
|
129
129
|
)
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
+
# Get a paginated list of delivery attempts for a specific webhook.
|
|
133
|
+
#
|
|
134
|
+
# Use this to:
|
|
135
|
+
#
|
|
136
|
+
# - Monitor webhook health and delivery success rate
|
|
137
|
+
# - Debug failed deliveries
|
|
138
|
+
# - Find specific events to replay
|
|
139
|
+
#
|
|
140
|
+
# **Filtering:**
|
|
141
|
+
#
|
|
142
|
+
# - Filter by success/failure to find problematic deliveries
|
|
143
|
+
# - Filter by event type to find specific events
|
|
144
|
+
# - Filter by time range for debugging recent issues
|
|
145
|
+
#
|
|
146
|
+
# **Retry behavior:** Failed deliveries are automatically retried with exponential
|
|
147
|
+
# backoff over ~3 days. Check `willRetry` to see if more attempts are scheduled.
|
|
148
|
+
#
|
|
149
|
+
# @overload list_deliveries(webhook_id, after: nil, before: nil, event: nil, page: nil, per_page: nil, success: nil, request_options: {})
|
|
150
|
+
#
|
|
151
|
+
# @param webhook_id [String] Webhook ID or UUID
|
|
152
|
+
#
|
|
153
|
+
# @param after [Integer] Only deliveries after this Unix timestamp
|
|
154
|
+
#
|
|
155
|
+
# @param before [Integer] Only deliveries before this Unix timestamp
|
|
156
|
+
#
|
|
157
|
+
# @param event [Symbol, ArkEmail::Models::WebhookListDeliveriesParams::Event] Filter by event type
|
|
158
|
+
#
|
|
159
|
+
# @param page [Integer] Page number (default 1)
|
|
160
|
+
#
|
|
161
|
+
# @param per_page [Integer] Items per page (default 30, max 100)
|
|
162
|
+
#
|
|
163
|
+
# @param success [Boolean] Filter by delivery success (true = 2xx response, false = non-2xx or error)
|
|
164
|
+
#
|
|
165
|
+
# @param request_options [ArkEmail::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
166
|
+
#
|
|
167
|
+
# @return [ArkEmail::Models::WebhookListDeliveriesResponse]
|
|
168
|
+
#
|
|
169
|
+
# @see ArkEmail::Models::WebhookListDeliveriesParams
|
|
170
|
+
def list_deliveries(webhook_id, params = {})
|
|
171
|
+
parsed, options = ArkEmail::WebhookListDeliveriesParams.dump_request(params)
|
|
172
|
+
@client.request(
|
|
173
|
+
method: :get,
|
|
174
|
+
path: ["webhooks/%1$s/deliveries", webhook_id],
|
|
175
|
+
query: parsed.transform_keys(per_page: "perPage"),
|
|
176
|
+
model: ArkEmail::Models::WebhookListDeliveriesResponse,
|
|
177
|
+
options: options
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Re-send a webhook delivery to your endpoint.
|
|
182
|
+
#
|
|
183
|
+
# **Use cases:**
|
|
184
|
+
#
|
|
185
|
+
# - Recover from transient failures after fixing your endpoint
|
|
186
|
+
# - Test endpoint changes with real historical data
|
|
187
|
+
# - Retry deliveries that failed due to downtime
|
|
188
|
+
#
|
|
189
|
+
# **How it works:**
|
|
190
|
+
#
|
|
191
|
+
# 1. Fetches the original payload from the delivery
|
|
192
|
+
# 2. Generates a new timestamp and signature
|
|
193
|
+
# 3. Sends to your webhook URL immediately
|
|
194
|
+
# 4. Returns the result (does not queue for retry if it fails)
|
|
195
|
+
#
|
|
196
|
+
# **Note:** The webhook must be enabled to replay deliveries.
|
|
197
|
+
#
|
|
198
|
+
# @overload replay_delivery(delivery_id, webhook_id:, request_options: {})
|
|
199
|
+
#
|
|
200
|
+
# @param delivery_id [String] Delivery ID (UUID) to replay
|
|
201
|
+
#
|
|
202
|
+
# @param webhook_id [String] Webhook ID or UUID
|
|
203
|
+
#
|
|
204
|
+
# @param request_options [ArkEmail::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
205
|
+
#
|
|
206
|
+
# @return [ArkEmail::Models::WebhookReplayDeliveryResponse]
|
|
207
|
+
#
|
|
208
|
+
# @see ArkEmail::Models::WebhookReplayDeliveryParams
|
|
209
|
+
def replay_delivery(delivery_id, params)
|
|
210
|
+
parsed, options = ArkEmail::WebhookReplayDeliveryParams.dump_request(params)
|
|
211
|
+
webhook_id =
|
|
212
|
+
parsed.delete(:webhook_id) do
|
|
213
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
214
|
+
end
|
|
215
|
+
@client.request(
|
|
216
|
+
method: :post,
|
|
217
|
+
path: ["webhooks/%1$s/deliveries/%2$s/replay", webhook_id, delivery_id],
|
|
218
|
+
model: ArkEmail::Models::WebhookReplayDeliveryResponse,
|
|
219
|
+
options: options
|
|
220
|
+
)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Get detailed information about a specific webhook delivery attempt.
|
|
224
|
+
#
|
|
225
|
+
# Returns:
|
|
226
|
+
#
|
|
227
|
+
# - The complete request payload that was sent
|
|
228
|
+
# - Request headers including the signature
|
|
229
|
+
# - Response status code and body from your endpoint
|
|
230
|
+
# - Timing information
|
|
231
|
+
#
|
|
232
|
+
# Use this to debug why a delivery failed or verify what data was sent.
|
|
233
|
+
#
|
|
234
|
+
# @overload retrieve_delivery(delivery_id, webhook_id:, request_options: {})
|
|
235
|
+
#
|
|
236
|
+
# @param delivery_id [String] Delivery ID (UUID)
|
|
237
|
+
#
|
|
238
|
+
# @param webhook_id [String] Webhook ID or UUID
|
|
239
|
+
#
|
|
240
|
+
# @param request_options [ArkEmail::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
241
|
+
#
|
|
242
|
+
# @return [ArkEmail::Models::WebhookRetrieveDeliveryResponse]
|
|
243
|
+
#
|
|
244
|
+
# @see ArkEmail::Models::WebhookRetrieveDeliveryParams
|
|
245
|
+
def retrieve_delivery(delivery_id, params)
|
|
246
|
+
parsed, options = ArkEmail::WebhookRetrieveDeliveryParams.dump_request(params)
|
|
247
|
+
webhook_id =
|
|
248
|
+
parsed.delete(:webhook_id) do
|
|
249
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
250
|
+
end
|
|
251
|
+
@client.request(
|
|
252
|
+
method: :get,
|
|
253
|
+
path: ["webhooks/%1$s/deliveries/%2$s", webhook_id, delivery_id],
|
|
254
|
+
model: ArkEmail::Models::WebhookRetrieveDeliveryResponse,
|
|
255
|
+
options: options
|
|
256
|
+
)
|
|
257
|
+
end
|
|
258
|
+
|
|
132
259
|
# Send a test payload to your webhook endpoint and verify it receives the data
|
|
133
260
|
# correctly.
|
|
134
261
|
#
|
data/lib/ark_email/version.rb
CHANGED
data/lib/ark_email.rb
CHANGED
|
@@ -106,8 +106,14 @@ require_relative "ark_email/models/webhook_create_params"
|
|
|
106
106
|
require_relative "ark_email/models/webhook_create_response"
|
|
107
107
|
require_relative "ark_email/models/webhook_delete_params"
|
|
108
108
|
require_relative "ark_email/models/webhook_delete_response"
|
|
109
|
+
require_relative "ark_email/models/webhook_list_deliveries_params"
|
|
110
|
+
require_relative "ark_email/models/webhook_list_deliveries_response"
|
|
109
111
|
require_relative "ark_email/models/webhook_list_params"
|
|
110
112
|
require_relative "ark_email/models/webhook_list_response"
|
|
113
|
+
require_relative "ark_email/models/webhook_replay_delivery_params"
|
|
114
|
+
require_relative "ark_email/models/webhook_replay_delivery_response"
|
|
115
|
+
require_relative "ark_email/models/webhook_retrieve_delivery_params"
|
|
116
|
+
require_relative "ark_email/models/webhook_retrieve_delivery_response"
|
|
111
117
|
require_relative "ark_email/models/webhook_retrieve_params"
|
|
112
118
|
require_relative "ark_email/models/webhook_retrieve_response"
|
|
113
119
|
require_relative "ark_email/models/webhook_test_params"
|
|
@@ -82,9 +82,18 @@ module ArkEmail
|
|
|
82
82
|
#
|
|
83
83
|
# This is useful for correlating webhook events with your internal systems (e.g.,
|
|
84
84
|
# user IDs, order IDs, campaign identifiers).
|
|
85
|
+
#
|
|
86
|
+
# **Validation Rules:**
|
|
87
|
+
#
|
|
88
|
+
# - Maximum 10 keys per email
|
|
89
|
+
# - Keys: 1-40 characters, must start with a letter, only alphanumeric and
|
|
90
|
+
# underscores (`^[a-zA-Z][a-zA-Z0-9_]*$`)
|
|
91
|
+
# - Values: 1-500 characters, no control characters (newlines, tabs, etc.)
|
|
92
|
+
# - Total size: 4KB maximum (JSON-encoded)
|
|
85
93
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
86
94
|
attr_accessor :metadata
|
|
87
95
|
|
|
96
|
+
# Tag for categorization and filtering
|
|
88
97
|
sig { returns(T.nilable(String)) }
|
|
89
98
|
attr_accessor :tag
|
|
90
99
|
|
|
@@ -115,7 +124,16 @@ module ArkEmail
|
|
|
115
124
|
#
|
|
116
125
|
# This is useful for correlating webhook events with your internal systems (e.g.,
|
|
117
126
|
# user IDs, order IDs, campaign identifiers).
|
|
127
|
+
#
|
|
128
|
+
# **Validation Rules:**
|
|
129
|
+
#
|
|
130
|
+
# - Maximum 10 keys per email
|
|
131
|
+
# - Keys: 1-40 characters, must start with a letter, only alphanumeric and
|
|
132
|
+
# underscores (`^[a-zA-Z][a-zA-Z0-9_]*$`)
|
|
133
|
+
# - Values: 1-500 characters, no control characters (newlines, tabs, etc.)
|
|
134
|
+
# - Total size: 4KB maximum (JSON-encoded)
|
|
118
135
|
metadata: nil,
|
|
136
|
+
# Tag for categorization and filtering
|
|
119
137
|
tag: nil,
|
|
120
138
|
text: nil
|
|
121
139
|
)
|
|
@@ -84,6 +84,14 @@ module ArkEmail
|
|
|
84
84
|
sig { returns(Integer) }
|
|
85
85
|
attr_accessor :total
|
|
86
86
|
|
|
87
|
+
# Whether this batch was sent in sandbox mode. Only present (and true) for sandbox
|
|
88
|
+
# emails sent from @arkhq.io addresses.
|
|
89
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
90
|
+
attr_reader :sandbox
|
|
91
|
+
|
|
92
|
+
sig { params(sandbox: T::Boolean).void }
|
|
93
|
+
attr_writer :sandbox
|
|
94
|
+
|
|
87
95
|
sig do
|
|
88
96
|
params(
|
|
89
97
|
accepted: Integer,
|
|
@@ -93,7 +101,8 @@ module ArkEmail
|
|
|
93
101
|
Symbol,
|
|
94
102
|
ArkEmail::Models::EmailSendBatchResponse::Data::Message::OrHash
|
|
95
103
|
],
|
|
96
|
-
total: Integer
|
|
104
|
+
total: Integer,
|
|
105
|
+
sandbox: T::Boolean
|
|
97
106
|
).returns(T.attached_class)
|
|
98
107
|
end
|
|
99
108
|
def self.new(
|
|
@@ -104,7 +113,10 @@ module ArkEmail
|
|
|
104
113
|
# Map of recipient email to message info
|
|
105
114
|
messages:,
|
|
106
115
|
# Total emails in the batch
|
|
107
|
-
total
|
|
116
|
+
total:,
|
|
117
|
+
# Whether this batch was sent in sandbox mode. Only present (and true) for sandbox
|
|
118
|
+
# emails sent from @arkhq.io addresses.
|
|
119
|
+
sandbox: nil
|
|
108
120
|
)
|
|
109
121
|
end
|
|
110
122
|
|
|
@@ -118,7 +130,8 @@ module ArkEmail
|
|
|
118
130
|
Symbol,
|
|
119
131
|
ArkEmail::Models::EmailSendBatchResponse::Data::Message
|
|
120
132
|
],
|
|
121
|
-
total: Integer
|
|
133
|
+
total: Integer,
|
|
134
|
+
sandbox: T::Boolean
|
|
122
135
|
}
|
|
123
136
|
)
|
|
124
137
|
end
|
|
@@ -11,7 +11,7 @@ module ArkEmail
|
|
|
11
11
|
T.any(ArkEmail::EmailSendParams, ArkEmail::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# Sender email address. Must be from a verified domain.
|
|
14
|
+
# Sender email address. Must be from a verified domain OR use sandbox mode.
|
|
15
15
|
#
|
|
16
16
|
# **Supported formats:**
|
|
17
17
|
#
|
|
@@ -20,6 +20,10 @@ module ArkEmail
|
|
|
20
20
|
# - With quoted name: `"Acme Support" <support@yourdomain.com>`
|
|
21
21
|
#
|
|
22
22
|
# The domain portion must match a verified sending domain in your account.
|
|
23
|
+
#
|
|
24
|
+
# **Sandbox mode:** Use `sandbox@arkhq.io` to send test emails without domain
|
|
25
|
+
# verification. Sandbox emails can only be sent to organization members and are
|
|
26
|
+
# limited to 10 per day.
|
|
23
27
|
sig { returns(String) }
|
|
24
28
|
attr_accessor :from
|
|
25
29
|
|
|
@@ -64,6 +68,14 @@ module ArkEmail
|
|
|
64
68
|
#
|
|
65
69
|
# This is useful for correlating webhook events with your internal systems (e.g.,
|
|
66
70
|
# user IDs, order IDs, campaign identifiers).
|
|
71
|
+
#
|
|
72
|
+
# **Validation Rules:**
|
|
73
|
+
#
|
|
74
|
+
# - Maximum 10 keys per email
|
|
75
|
+
# - Keys: 1-40 characters, must start with a letter, only alphanumeric and
|
|
76
|
+
# underscores (`^[a-zA-Z][a-zA-Z0-9_]*$`)
|
|
77
|
+
# - Values: 1-500 characters, no control characters (newlines, tabs, etc.)
|
|
78
|
+
# - Total size: 4KB maximum (JSON-encoded)
|
|
67
79
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
68
80
|
attr_accessor :metadata
|
|
69
81
|
|
|
@@ -106,7 +118,7 @@ module ArkEmail
|
|
|
106
118
|
).returns(T.attached_class)
|
|
107
119
|
end
|
|
108
120
|
def self.new(
|
|
109
|
-
# Sender email address. Must be from a verified domain.
|
|
121
|
+
# Sender email address. Must be from a verified domain OR use sandbox mode.
|
|
110
122
|
#
|
|
111
123
|
# **Supported formats:**
|
|
112
124
|
#
|
|
@@ -115,6 +127,10 @@ module ArkEmail
|
|
|
115
127
|
# - With quoted name: `"Acme Support" <support@yourdomain.com>`
|
|
116
128
|
#
|
|
117
129
|
# The domain portion must match a verified sending domain in your account.
|
|
130
|
+
#
|
|
131
|
+
# **Sandbox mode:** Use `sandbox@arkhq.io` to send test emails without domain
|
|
132
|
+
# verification. Sandbox emails can only be sent to organization members and are
|
|
133
|
+
# limited to 10 per day.
|
|
118
134
|
from:,
|
|
119
135
|
# Email subject line
|
|
120
136
|
subject:,
|
|
@@ -141,6 +157,14 @@ module ArkEmail
|
|
|
141
157
|
#
|
|
142
158
|
# This is useful for correlating webhook events with your internal systems (e.g.,
|
|
143
159
|
# user IDs, order IDs, campaign identifiers).
|
|
160
|
+
#
|
|
161
|
+
# **Validation Rules:**
|
|
162
|
+
#
|
|
163
|
+
# - Maximum 10 keys per email
|
|
164
|
+
# - Keys: 1-40 characters, must start with a letter, only alphanumeric and
|
|
165
|
+
# underscores (`^[a-zA-Z][a-zA-Z0-9_]*$`)
|
|
166
|
+
# - Values: 1-500 characters, no control characters (newlines, tabs, etc.)
|
|
167
|
+
# - Total size: 4KB maximum (JSON-encoded)
|
|
144
168
|
metadata: nil,
|
|
145
169
|
# Reply-to address (accepts null)
|
|
146
170
|
reply_to: nil,
|
|
@@ -82,13 +82,22 @@ module ArkEmail
|
|
|
82
82
|
sig { params(message_id: String).void }
|
|
83
83
|
attr_writer :message_id
|
|
84
84
|
|
|
85
|
+
# Whether this email was sent in sandbox mode. Only present (and true) for sandbox
|
|
86
|
+
# emails sent from @arkhq.io addresses.
|
|
87
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
88
|
+
attr_reader :sandbox
|
|
89
|
+
|
|
90
|
+
sig { params(sandbox: T::Boolean).void }
|
|
91
|
+
attr_writer :sandbox
|
|
92
|
+
|
|
85
93
|
sig do
|
|
86
94
|
params(
|
|
87
95
|
id: String,
|
|
88
96
|
status:
|
|
89
97
|
ArkEmail::Models::EmailSendRawResponse::Data::Status::OrSymbol,
|
|
90
98
|
to: T::Array[String],
|
|
91
|
-
message_id: String
|
|
99
|
+
message_id: String,
|
|
100
|
+
sandbox: T::Boolean
|
|
92
101
|
).returns(T.attached_class)
|
|
93
102
|
end
|
|
94
103
|
def self.new(
|
|
@@ -99,7 +108,10 @@ module ArkEmail
|
|
|
99
108
|
# List of recipient addresses
|
|
100
109
|
to:,
|
|
101
110
|
# SMTP Message-ID header value
|
|
102
|
-
message_id: nil
|
|
111
|
+
message_id: nil,
|
|
112
|
+
# Whether this email was sent in sandbox mode. Only present (and true) for sandbox
|
|
113
|
+
# emails sent from @arkhq.io addresses.
|
|
114
|
+
sandbox: nil
|
|
103
115
|
)
|
|
104
116
|
end
|
|
105
117
|
|
|
@@ -110,7 +122,8 @@ module ArkEmail
|
|
|
110
122
|
status:
|
|
111
123
|
ArkEmail::Models::EmailSendRawResponse::Data::Status::TaggedSymbol,
|
|
112
124
|
to: T::Array[String],
|
|
113
|
-
message_id: String
|
|
125
|
+
message_id: String,
|
|
126
|
+
sandbox: T::Boolean
|
|
114
127
|
}
|
|
115
128
|
)
|
|
116
129
|
end
|
|
@@ -82,12 +82,21 @@ module ArkEmail
|
|
|
82
82
|
sig { params(message_id: String).void }
|
|
83
83
|
attr_writer :message_id
|
|
84
84
|
|
|
85
|
+
# Whether this email was sent in sandbox mode. Only present (and true) for sandbox
|
|
86
|
+
# emails sent from @arkhq.io addresses.
|
|
87
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
88
|
+
attr_reader :sandbox
|
|
89
|
+
|
|
90
|
+
sig { params(sandbox: T::Boolean).void }
|
|
91
|
+
attr_writer :sandbox
|
|
92
|
+
|
|
85
93
|
sig do
|
|
86
94
|
params(
|
|
87
95
|
id: String,
|
|
88
96
|
status: ArkEmail::Models::EmailSendResponse::Data::Status::OrSymbol,
|
|
89
97
|
to: T::Array[String],
|
|
90
|
-
message_id: String
|
|
98
|
+
message_id: String,
|
|
99
|
+
sandbox: T::Boolean
|
|
91
100
|
).returns(T.attached_class)
|
|
92
101
|
end
|
|
93
102
|
def self.new(
|
|
@@ -98,7 +107,10 @@ module ArkEmail
|
|
|
98
107
|
# List of recipient addresses
|
|
99
108
|
to:,
|
|
100
109
|
# SMTP Message-ID header value
|
|
101
|
-
message_id: nil
|
|
110
|
+
message_id: nil,
|
|
111
|
+
# Whether this email was sent in sandbox mode. Only present (and true) for sandbox
|
|
112
|
+
# emails sent from @arkhq.io addresses.
|
|
113
|
+
sandbox: nil
|
|
102
114
|
)
|
|
103
115
|
end
|
|
104
116
|
|
|
@@ -109,7 +121,8 @@ module ArkEmail
|
|
|
109
121
|
status:
|
|
110
122
|
ArkEmail::Models::EmailSendResponse::Data::Status::TaggedSymbol,
|
|
111
123
|
to: T::Array[String],
|
|
112
|
-
message_id: String
|
|
124
|
+
message_id: String,
|
|
125
|
+
sandbox: T::Boolean
|
|
113
126
|
}
|
|
114
127
|
)
|
|
115
128
|
end
|