sendly 3.5.3 → 3.6.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/Gemfile.lock +1 -1
- data/README.md +109 -0
- data/lib/sendly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc3667b089d1fc494d8d71a8a184a448ee23040ccab772e3640da4743385b291
|
|
4
|
+
data.tar.gz: a0ccba6bb44cdbfa5a5b01d4882731d1f56c08944b7477f45cf3b779177285c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e59c3aadde64d289b0efca5e7658e2c248846def6233c6c181c070fefa30438d6aaa1bb1eaa25a1fb2f76336d0613d4a4c10d98ddc1d0ef7e97eea2fdc630d9
|
|
7
|
+
data.tar.gz: 5ded3801ac0f23d66eaf86628f0e86262fe0f3d028734db22aedaa45cfce4ba3ed951bbf2cfdd4e9a7e41d4f18f053e260cea0224dfd314af33549f153411853
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -135,6 +135,55 @@ puts message.status
|
|
|
135
135
|
puts message.delivered_at
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
+
### Scheduling Messages
|
|
139
|
+
|
|
140
|
+
```ruby
|
|
141
|
+
# Schedule a message for future delivery
|
|
142
|
+
scheduled = client.messages.schedule(
|
|
143
|
+
to: "+15551234567",
|
|
144
|
+
text: "Your appointment is tomorrow!",
|
|
145
|
+
scheduled_at: "2025-01-15T10:00:00Z"
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
puts scheduled.id
|
|
149
|
+
puts scheduled.scheduled_at
|
|
150
|
+
|
|
151
|
+
# List scheduled messages
|
|
152
|
+
result = client.messages.list_scheduled
|
|
153
|
+
result.data.each { |msg| puts "#{msg.id}: #{msg.scheduled_at}" }
|
|
154
|
+
|
|
155
|
+
# Get a specific scheduled message
|
|
156
|
+
msg = client.messages.get_scheduled("sched_xxx")
|
|
157
|
+
|
|
158
|
+
# Cancel a scheduled message (refunds credits)
|
|
159
|
+
result = client.messages.cancel_scheduled("sched_xxx")
|
|
160
|
+
puts "Refunded: #{result.credits_refunded} credits"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Batch Messages
|
|
164
|
+
|
|
165
|
+
```ruby
|
|
166
|
+
# Send multiple messages in one API call (up to 1000)
|
|
167
|
+
batch = client.messages.send_batch(
|
|
168
|
+
messages: [
|
|
169
|
+
{ to: "+15551234567", text: "Hello User 1!" },
|
|
170
|
+
{ to: "+15559876543", text: "Hello User 2!" },
|
|
171
|
+
{ to: "+15551112222", text: "Hello User 3!" }
|
|
172
|
+
]
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
puts batch.batch_id
|
|
176
|
+
puts "Queued: #{batch.queued}"
|
|
177
|
+
puts "Failed: #{batch.failed}"
|
|
178
|
+
puts "Credits used: #{batch.credits_used}"
|
|
179
|
+
|
|
180
|
+
# Get batch status
|
|
181
|
+
status = client.messages.get_batch("batch_xxx")
|
|
182
|
+
|
|
183
|
+
# List all batches
|
|
184
|
+
batches = client.messages.list_batches
|
|
185
|
+
```
|
|
186
|
+
|
|
138
187
|
### Iterate All Messages
|
|
139
188
|
|
|
140
189
|
```ruby
|
|
@@ -149,6 +198,66 @@ client.messages.each(status: "delivered") do |message|
|
|
|
149
198
|
end
|
|
150
199
|
```
|
|
151
200
|
|
|
201
|
+
## Webhooks
|
|
202
|
+
|
|
203
|
+
```ruby
|
|
204
|
+
# Create a webhook endpoint
|
|
205
|
+
webhook = client.webhooks.create(
|
|
206
|
+
url: "https://example.com/webhooks/sendly",
|
|
207
|
+
events: ["message.delivered", "message.failed"]
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
puts webhook.id
|
|
211
|
+
puts webhook.secret # Store securely!
|
|
212
|
+
|
|
213
|
+
# List all webhooks
|
|
214
|
+
webhooks = client.webhooks.list
|
|
215
|
+
|
|
216
|
+
# Get a specific webhook
|
|
217
|
+
wh = client.webhooks.get("whk_xxx")
|
|
218
|
+
|
|
219
|
+
# Update a webhook
|
|
220
|
+
client.webhooks.update("whk_xxx",
|
|
221
|
+
url: "https://new-endpoint.example.com/webhook",
|
|
222
|
+
events: ["message.delivered", "message.failed", "message.sent"]
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
# Test a webhook
|
|
226
|
+
result = client.webhooks.test("whk_xxx")
|
|
227
|
+
|
|
228
|
+
# Rotate webhook secret
|
|
229
|
+
rotation = client.webhooks.rotate_secret("whk_xxx")
|
|
230
|
+
|
|
231
|
+
# Delete a webhook
|
|
232
|
+
client.webhooks.delete("whk_xxx")
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Account & Credits
|
|
236
|
+
|
|
237
|
+
```ruby
|
|
238
|
+
# Get account information
|
|
239
|
+
account = client.account.get
|
|
240
|
+
puts account.email
|
|
241
|
+
|
|
242
|
+
# Check credit balance
|
|
243
|
+
credits = client.account.get_credits
|
|
244
|
+
puts "Available: #{credits.available_balance} credits"
|
|
245
|
+
puts "Reserved: #{credits.reserved_balance} credits"
|
|
246
|
+
puts "Total: #{credits.balance} credits"
|
|
247
|
+
|
|
248
|
+
# View credit transaction history
|
|
249
|
+
result = client.account.get_credit_transactions
|
|
250
|
+
result.data.each do |tx|
|
|
251
|
+
puts "#{tx.type}: #{tx.amount} credits - #{tx.description}"
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# List API keys
|
|
255
|
+
result = client.account.list_api_keys
|
|
256
|
+
result.data.each do |key|
|
|
257
|
+
puts "#{key.name}: #{key.prefix}*** (#{key.type})"
|
|
258
|
+
end
|
|
259
|
+
```
|
|
260
|
+
|
|
152
261
|
## Error Handling
|
|
153
262
|
|
|
154
263
|
```ruby
|
data/lib/sendly/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sendly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sendly
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|