sendly 3.13.1 → 3.15.1
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/lib/sendly/messages.rb +6 -3
- 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: ea3ee275f9fb56425c1b7ffe027686a5785039377e58b2660c39bf61b5b7095c
|
|
4
|
+
data.tar.gz: 17e4c8c2ef09c8ff0a5041e4288e4661b17a0233714527b4dd07984c3142129b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee401755db04ba02207013d53b552a6ad433b241a2d1594c82d49fedb0641dc327aedf9e9d5dc38732b8d4f41a90e96464c19717dc8b37d702bedc9fe9255522
|
|
7
|
+
data.tar.gz: d7da1728cc53d0a111429683d3151bc891aa2a2fc74a7fc67b49e812b97eceaee3b85c59f4e5685b5d191b1c78966aca1f1677ba64ad90b86cb100309142678f
|
data/Gemfile.lock
CHANGED
data/lib/sendly/messages.rb
CHANGED
|
@@ -35,12 +35,13 @@ module Sendly
|
|
|
35
35
|
# text: "Your verification code is 123456",
|
|
36
36
|
# message_type: "transactional"
|
|
37
37
|
# )
|
|
38
|
-
def send(to:, text:, message_type: nil)
|
|
38
|
+
def send(to:, text:, message_type: nil, metadata: nil)
|
|
39
39
|
validate_phone!(to)
|
|
40
40
|
validate_text!(text)
|
|
41
41
|
|
|
42
42
|
body = { to: to, text: text }
|
|
43
43
|
body[:messageType] = message_type if message_type
|
|
44
|
+
body[:metadata] = metadata if metadata
|
|
44
45
|
|
|
45
46
|
response = client.post("/messages", body)
|
|
46
47
|
# API returns message directly at top level
|
|
@@ -140,7 +141,7 @@ module Sendly
|
|
|
140
141
|
# scheduled_at: "2025-01-20T10:00:00Z"
|
|
141
142
|
# )
|
|
142
143
|
# puts scheduled["id"]
|
|
143
|
-
def schedule(to:, text:, scheduled_at:, from: nil, message_type: nil)
|
|
144
|
+
def schedule(to:, text:, scheduled_at:, from: nil, message_type: nil, metadata: nil)
|
|
144
145
|
validate_phone!(to)
|
|
145
146
|
validate_text!(text)
|
|
146
147
|
raise ValidationError, "scheduled_at is required" if scheduled_at.nil? || scheduled_at.empty?
|
|
@@ -148,6 +149,7 @@ module Sendly
|
|
|
148
149
|
body = { to: to, text: text, scheduledAt: scheduled_at }
|
|
149
150
|
body[:from] = from if from
|
|
150
151
|
body[:messageType] = message_type if message_type
|
|
152
|
+
body[:metadata] = metadata if metadata
|
|
151
153
|
|
|
152
154
|
client.post("/messages/schedule", body)
|
|
153
155
|
end
|
|
@@ -225,7 +227,7 @@ module Sendly
|
|
|
225
227
|
# ]
|
|
226
228
|
# )
|
|
227
229
|
# puts "Batch #{result['batchId']}: #{result['queued']} queued"
|
|
228
|
-
def send_batch(messages:, from: nil, message_type: nil)
|
|
230
|
+
def send_batch(messages:, from: nil, message_type: nil, metadata: nil)
|
|
229
231
|
raise ValidationError, "Messages array is required" if messages.nil? || messages.empty?
|
|
230
232
|
|
|
231
233
|
messages.each_with_index do |msg, i|
|
|
@@ -241,6 +243,7 @@ module Sendly
|
|
|
241
243
|
body = { messages: messages }
|
|
242
244
|
body[:from] = from if from
|
|
243
245
|
body[:messageType] = message_type if message_type
|
|
246
|
+
body[:metadata] = metadata if metadata
|
|
244
247
|
|
|
245
248
|
client.post("/messages/batch", body)
|
|
246
249
|
end
|
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.15.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sendly
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|