sendly 3.34.0 → 3.35.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/lib/sendly/messages.rb +3 -1
- data/lib/sendly/numbers_resource.rb +15 -2
- 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: '09a32581d4ce1256ffd2bf348216cf42877665720fd31f7eab4ff50ba9eb30be'
|
|
4
|
+
data.tar.gz: f713cd2607feeeab90f997a66580d888c2da4bc7b6cf427c4fd77b27dadd866b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c0e5cf78135e5e1571d724084aeb850928fdf96fb1bdb9ada800835574816ea54b5bb5cca17298c3aac26d456b0704cce9a3a177e797f800af65c538533a5ff
|
|
7
|
+
data.tar.gz: 9ad05417089aeb02dff49dc4e33a66484cf6cc1ffd03aefa35e21b7d7b7d9745de7bc7ddbcf2330bc7d57a625e208c0778ce37fe0efd410536391fe2ef178d71
|
data/Gemfile.lock
CHANGED
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 from [String] Sender ID or phone number (optional)
|
|
17
18
|
# @param message_type [String] Message type: "marketing" (default) or "transactional"
|
|
18
19
|
# @param metadata [Hash] Custom JSON metadata to attach to the message (max 4KB)
|
|
19
20
|
# @return [Sendly::Message] The sent message
|
|
@@ -36,11 +37,12 @@ module Sendly
|
|
|
36
37
|
# text: "Your verification code is 123456",
|
|
37
38
|
# message_type: "transactional"
|
|
38
39
|
# )
|
|
39
|
-
def send(to:, text:, message_type: nil, metadata: nil, media_urls: nil)
|
|
40
|
+
def send(to:, text:, from: nil, message_type: nil, metadata: nil, media_urls: nil)
|
|
40
41
|
validate_phone!(to)
|
|
41
42
|
validate_text!(text)
|
|
42
43
|
|
|
43
44
|
body = { to: to, text: text }
|
|
45
|
+
body[:from] = from if from
|
|
44
46
|
body[:messageType] = message_type if message_type
|
|
45
47
|
body[:metadata] = metadata if metadata
|
|
46
48
|
body[:mediaUrls] = media_urls if media_urls
|
|
@@ -42,7 +42,14 @@ module Sendly
|
|
|
42
42
|
# A number owned by the account.
|
|
43
43
|
class PhoneNumber
|
|
44
44
|
attr_reader :id, :phone_number, :status, :source, :country_code,
|
|
45
|
-
:phone_number_type, :monthly_cost_cents
|
|
45
|
+
:phone_number_type, :monthly_cost_cents,
|
|
46
|
+
# ISO-8601 timestamp string, or nil when the number still needs
|
|
47
|
+
# regulatory documents (a value means docs are under carrier review).
|
|
48
|
+
:requirements_submitted_at,
|
|
49
|
+
# true when the number is scheduled for release at period end.
|
|
50
|
+
:pending_cancellation,
|
|
51
|
+
# ISO-8601 timestamp string, or nil when no release is scheduled.
|
|
52
|
+
:scheduled_release_at
|
|
46
53
|
|
|
47
54
|
def initialize(data)
|
|
48
55
|
@id = data["id"]
|
|
@@ -52,13 +59,19 @@ module Sendly
|
|
|
52
59
|
@country_code = data["countryCode"] || data["country_code"]
|
|
53
60
|
@phone_number_type = data["phoneNumberType"] || data["phone_number_type"]
|
|
54
61
|
@monthly_cost_cents = data["monthlyCostCents"] || data["monthly_cost_cents"]
|
|
62
|
+
@requirements_submitted_at = data["requirementsSubmittedAt"] || data["requirements_submitted_at"]
|
|
63
|
+
@pending_cancellation = data.key?("pendingCancellation") ? data["pendingCancellation"] : data["pending_cancellation"]
|
|
64
|
+
@scheduled_release_at = data["scheduledReleaseAt"] || data["scheduled_release_at"]
|
|
55
65
|
end
|
|
56
66
|
|
|
57
67
|
def to_h
|
|
58
68
|
{
|
|
59
69
|
id: id, phone_number: phone_number, status: status, source: source,
|
|
60
70
|
country_code: country_code, phone_number_type: phone_number_type,
|
|
61
|
-
monthly_cost_cents: monthly_cost_cents
|
|
71
|
+
monthly_cost_cents: monthly_cost_cents,
|
|
72
|
+
requirements_submitted_at: requirements_submitted_at,
|
|
73
|
+
pending_cancellation: pending_cancellation,
|
|
74
|
+
scheduled_release_at: scheduled_release_at
|
|
62
75
|
}.compact
|
|
63
76
|
end
|
|
64
77
|
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.35.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sendly
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|