sendly 3.15.1 → 3.15.2
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 +7 -0
- data/lib/sendly/messages.rb +3 -0
- data/lib/sendly/types.rb +6 -1
- 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: 56c908f29c221c85c90e24d73b43066013f4d3cec54aba6fe7517fb227e045b4
|
|
4
|
+
data.tar.gz: d128303727afab0708a108693a8effc1026296ade3b90e2de848286166d8eaea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce1fa34f4d023c436c61fca5edd146f14eb57c8e7b881ed6e34f10d3aa1cfa18a0304fae311251c0c3dcb89ad86b0888ca74297d809d0f7863af6c808371f455
|
|
7
|
+
data.tar.gz: 9b1f5393016e47ec383a5436942c4da13f34acf65b95bb764d32aff4b83f615f3394326213926ad56ca2aa3bcfcecb2320ee07286215f1f8c2d7939b2c2457f7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -108,6 +108,13 @@ message = client.messages.send(
|
|
|
108
108
|
message_type: "transactional"
|
|
109
109
|
)
|
|
110
110
|
|
|
111
|
+
# With custom metadata (max 4KB)
|
|
112
|
+
message = client.messages.send(
|
|
113
|
+
to: "+15551234567",
|
|
114
|
+
text: "Your order #12345 has shipped!",
|
|
115
|
+
metadata: { order_id: "12345", customer_id: "cust_abc" }
|
|
116
|
+
)
|
|
117
|
+
|
|
111
118
|
puts message.id
|
|
112
119
|
puts message.status
|
|
113
120
|
puts message.credits_used
|
data/lib/sendly/messages.rb
CHANGED
|
@@ -15,6 +15,7 @@ module Sendly
|
|
|
15
15
|
# @param to [String] Recipient phone number in E.164 format
|
|
16
16
|
# @param text [String] Message content (max 1600 characters)
|
|
17
17
|
# @param message_type [String] Message type: "marketing" (default) or "transactional"
|
|
18
|
+
# @param metadata [Hash] Custom JSON metadata to attach to the message (max 4KB)
|
|
18
19
|
# @return [Sendly::Message] The sent message
|
|
19
20
|
#
|
|
20
21
|
# @raise [Sendly::ValidationError] If parameters are invalid
|
|
@@ -130,6 +131,7 @@ module Sendly
|
|
|
130
131
|
# @param scheduled_at [String] ISO 8601 datetime for when to send
|
|
131
132
|
# @param from [String] Sender ID or phone number (optional)
|
|
132
133
|
# @param message_type [String] Message type: "marketing" (default) or "transactional"
|
|
134
|
+
# @param metadata [Hash] Custom JSON metadata to attach to the message (max 4KB)
|
|
133
135
|
# @return [Hash] The scheduled message
|
|
134
136
|
#
|
|
135
137
|
# @raise [Sendly::ValidationError] If parameters are invalid
|
|
@@ -214,6 +216,7 @@ module Sendly
|
|
|
214
216
|
# @param messages [Array<Hash>] Array of messages with :to and :text keys
|
|
215
217
|
# @param from [String] Sender ID or phone number (optional, applies to all)
|
|
216
218
|
# @param message_type [String] Message type: "marketing" (default) or "transactional"
|
|
219
|
+
# @param metadata [Hash] Shared metadata for all messages (max 4KB). Each message can also have its own metadata hash which takes priority.
|
|
217
220
|
# @return [Hash] Batch response with batch_id and status
|
|
218
221
|
#
|
|
219
222
|
# @raise [Sendly::ValidationError] If parameters are invalid
|
data/lib/sendly/types.rb
CHANGED
|
@@ -51,6 +51,9 @@ module Sendly
|
|
|
51
51
|
# @return [Time, nil] Delivery timestamp
|
|
52
52
|
attr_reader :delivered_at
|
|
53
53
|
|
|
54
|
+
# @return [Hash, nil] Custom metadata attached to the message
|
|
55
|
+
attr_reader :metadata
|
|
56
|
+
|
|
54
57
|
# Message status constants (sending removed - doesn't exist in database)
|
|
55
58
|
STATUSES = %w[queued sent delivered failed bounced].freeze
|
|
56
59
|
|
|
@@ -74,6 +77,7 @@ module Sendly
|
|
|
74
77
|
@sender_note = data["senderNote"]
|
|
75
78
|
@created_at = parse_time(data["createdAt"])
|
|
76
79
|
@delivered_at = parse_time(data["deliveredAt"])
|
|
80
|
+
@metadata = data["metadata"]
|
|
77
81
|
end
|
|
78
82
|
|
|
79
83
|
# Check if message was delivered
|
|
@@ -113,7 +117,8 @@ module Sendly
|
|
|
113
117
|
warning: warning,
|
|
114
118
|
sender_note: sender_note,
|
|
115
119
|
created_at: created_at&.iso8601,
|
|
116
|
-
delivered_at: delivered_at&.iso8601
|
|
120
|
+
delivered_at: delivered_at&.iso8601,
|
|
121
|
+
metadata: metadata
|
|
117
122
|
}.compact
|
|
118
123
|
end
|
|
119
124
|
|
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.15.
|
|
4
|
+
version: 3.15.2
|
|
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-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|