sendly 3.1.0 → 3.4.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 +3 -3
- data/lib/sendly/messages.rb +19 -4
- data/lib/sendly/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 589daabda1501b7726c11abf2bceb8877978c98548a36ac6a23334979307c475
|
|
4
|
+
data.tar.gz: 292ac38cf1420e2dad947ec2969b527672ba306cfe8f1ef228bf492e5d60cec2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b26012a6d67959dc56643c51bb40639867350754482171d4e93980c29c37d4ed8ae7d3ee831360bcd45d1313bc727cf079aae9709b229a1a39a954aa21001a86
|
|
7
|
+
data.tar.gz: a9890cd4bd6bfcec7e37063b331f2b1b72713024781bc41a0765a015aba2c58f502cf0dc3b99c05e5648de38d41ca1fc1306b7a351d3da49099008760766bce1
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
sendly (3.
|
|
4
|
+
sendly (3.4.0)
|
|
5
5
|
faraday (~> 2.0)
|
|
6
6
|
faraday-retry (~> 2.0)
|
|
7
7
|
|
|
@@ -36,7 +36,7 @@ GEM
|
|
|
36
36
|
ast (~> 2.4.1)
|
|
37
37
|
racc
|
|
38
38
|
prism (1.6.0)
|
|
39
|
-
public_suffix (
|
|
39
|
+
public_suffix (6.0.2)
|
|
40
40
|
racc (1.8.1)
|
|
41
41
|
rainbow (3.1.1)
|
|
42
42
|
rake (13.3.1)
|
|
@@ -92,4 +92,4 @@ DEPENDENCIES
|
|
|
92
92
|
webmock (~> 3.0)
|
|
93
93
|
|
|
94
94
|
BUNDLED WITH
|
|
95
|
-
2.
|
|
95
|
+
2.5.23
|
data/lib/sendly/messages.rb
CHANGED
|
@@ -14,6 +14,7 @@ module Sendly
|
|
|
14
14
|
#
|
|
15
15
|
# @param to [String] Recipient phone number in E.164 format
|
|
16
16
|
# @param text [String] Message content (max 1600 characters)
|
|
17
|
+
# @param message_type [String] Message type: "marketing" (default) or "transactional"
|
|
17
18
|
# @return [Sendly::Message] The sent message
|
|
18
19
|
#
|
|
19
20
|
# @raise [Sendly::ValidationError] If parameters are invalid
|
|
@@ -27,11 +28,21 @@ module Sendly
|
|
|
27
28
|
# )
|
|
28
29
|
# puts message.id
|
|
29
30
|
# puts message.status
|
|
30
|
-
|
|
31
|
+
#
|
|
32
|
+
# @example Transactional message (bypasses quiet hours)
|
|
33
|
+
# message = client.messages.send(
|
|
34
|
+
# to: "+15551234567",
|
|
35
|
+
# text: "Your verification code is 123456",
|
|
36
|
+
# message_type: "transactional"
|
|
37
|
+
# )
|
|
38
|
+
def send(to:, text:, message_type: nil)
|
|
31
39
|
validate_phone!(to)
|
|
32
40
|
validate_text!(text)
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
body = { to: to, text: text }
|
|
43
|
+
body[:messageType] = message_type if message_type
|
|
44
|
+
|
|
45
|
+
response = client.post("/messages", body)
|
|
35
46
|
# API returns message directly at top level
|
|
36
47
|
Message.new(response)
|
|
37
48
|
end
|
|
@@ -117,6 +128,7 @@ module Sendly
|
|
|
117
128
|
# @param text [String] Message content (max 1600 characters)
|
|
118
129
|
# @param scheduled_at [String] ISO 8601 datetime for when to send
|
|
119
130
|
# @param from [String] Sender ID or phone number (optional)
|
|
131
|
+
# @param message_type [String] Message type: "marketing" (default) or "transactional"
|
|
120
132
|
# @return [Hash] The scheduled message
|
|
121
133
|
#
|
|
122
134
|
# @raise [Sendly::ValidationError] If parameters are invalid
|
|
@@ -128,13 +140,14 @@ module Sendly
|
|
|
128
140
|
# scheduled_at: "2025-01-20T10:00:00Z"
|
|
129
141
|
# )
|
|
130
142
|
# puts scheduled["id"]
|
|
131
|
-
def schedule(to:, text:, scheduled_at:, from: nil)
|
|
143
|
+
def schedule(to:, text:, scheduled_at:, from: nil, message_type: nil)
|
|
132
144
|
validate_phone!(to)
|
|
133
145
|
validate_text!(text)
|
|
134
146
|
raise ValidationError, "scheduled_at is required" if scheduled_at.nil? || scheduled_at.empty?
|
|
135
147
|
|
|
136
148
|
body = { to: to, text: text, scheduledAt: scheduled_at }
|
|
137
149
|
body[:from] = from if from
|
|
150
|
+
body[:messageType] = message_type if message_type
|
|
138
151
|
|
|
139
152
|
client.post("/messages/schedule", body)
|
|
140
153
|
end
|
|
@@ -198,6 +211,7 @@ module Sendly
|
|
|
198
211
|
#
|
|
199
212
|
# @param messages [Array<Hash>] Array of messages with :to and :text keys
|
|
200
213
|
# @param from [String] Sender ID or phone number (optional, applies to all)
|
|
214
|
+
# @param message_type [String] Message type: "marketing" (default) or "transactional"
|
|
201
215
|
# @return [Hash] Batch response with batch_id and status
|
|
202
216
|
#
|
|
203
217
|
# @raise [Sendly::ValidationError] If parameters are invalid
|
|
@@ -211,7 +225,7 @@ module Sendly
|
|
|
211
225
|
# ]
|
|
212
226
|
# )
|
|
213
227
|
# puts "Batch #{result['batchId']}: #{result['queued']} queued"
|
|
214
|
-
def send_batch(messages:, from: nil)
|
|
228
|
+
def send_batch(messages:, from: nil, message_type: nil)
|
|
215
229
|
raise ValidationError, "Messages array is required" if messages.nil? || messages.empty?
|
|
216
230
|
|
|
217
231
|
messages.each_with_index do |msg, i|
|
|
@@ -226,6 +240,7 @@ module Sendly
|
|
|
226
240
|
|
|
227
241
|
body = { messages: messages }
|
|
228
242
|
body[:from] = from if from
|
|
243
|
+
body[:messageType] = message_type if message_type
|
|
229
244
|
|
|
230
245
|
client.post("/messages/batch", body)
|
|
231
246
|
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.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sendly
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-12-
|
|
11
|
+
date: 2025-12-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -139,7 +139,7 @@ metadata:
|
|
|
139
139
|
source_code_uri: https://github.com/sendly-live/sendly-ruby
|
|
140
140
|
changelog_uri: https://github.com/sendly-live/sendly-ruby/blob/main/CHANGELOG.md
|
|
141
141
|
documentation_uri: https://sendly.live/docs
|
|
142
|
-
post_install_message:
|
|
142
|
+
post_install_message:
|
|
143
143
|
rdoc_options: []
|
|
144
144
|
require_paths:
|
|
145
145
|
- lib
|
|
@@ -154,8 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
154
|
- !ruby/object:Gem::Version
|
|
155
155
|
version: '0'
|
|
156
156
|
requirements: []
|
|
157
|
-
rubygems_version: 3.
|
|
158
|
-
signing_key:
|
|
157
|
+
rubygems_version: 3.3.5
|
|
158
|
+
signing_key:
|
|
159
159
|
specification_version: 4
|
|
160
160
|
summary: Official Ruby SDK for the Sendly SMS API
|
|
161
161
|
test_files: []
|