sendly 3.5.3 → 3.5.4

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +109 -0
  4. data/lib/sendly/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfbe3c41474a139bbc696703c0fd728aed567dab46adef7c8cfeba7c12c1925a
4
- data.tar.gz: 9732bbbd47aa1645b03b3bdaa4b237b47a6a0493d5e5e6da6acf3c19b94f62c9
3
+ metadata.gz: acdd7d0e32f947707ee880aa448bf6d609fdf04b0276c3db3e13eb8d437981bb
4
+ data.tar.gz: 2c53e468cefc039756589b372c1e1f3ba521dd0785beae1ecfdc63278c852b90
5
5
  SHA512:
6
- metadata.gz: 9d466ee910b40ec393668fb4945679a4bc111ee96afa422bd3dc47b369bfebce4749debdf87c863136b6ab179be847e77eb6afd00f4a43397af7532b358f9204
7
- data.tar.gz: 163f373a94fa5882385b237cfae0b99c0b3170cc7ac038df66801270662eb8f3f1b50decc7f20b4ac16cae040b8c92c1647f3800bfe877e4dc76ef3d05247d98
6
+ metadata.gz: a4089829bd5495482eab7d32e1ab3ffd4c8ab4ec6183eee5d865f8df12c5944d02cf47791e2403b50b44184bf8939dc47122378caaec9c5080475664523cf633
7
+ data.tar.gz: c6bc73e5563d6d91d3c6c13cefd5681cad855c1ba0781a60137dd5e442e77c6d12267a659f01181a360247b12ba588a1ded139352f957af02c0c0cd0624777c1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sendly (3.5.3)
4
+ sendly (3.5.4)
5
5
  faraday (~> 2.0)
6
6
  faraday-retry (~> 2.0)
7
7
 
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sendly
4
- VERSION = "3.5.3"
4
+ VERSION = "3.5.4"
5
5
  end
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.5.3
4
+ version: 3.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sendly
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-12-30 00:00:00.000000000 Z
11
+ date: 2026-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday