sendly 3.13.0 → 3.13.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1468fb0c87212a7d6f930ad557fc6b9546eca11a292ac8c7873c9db1d209ac1
4
- data.tar.gz: bf62a3866fa8c02557d5925d175fe06c0de554c00d0bb371b1178d2eff84f5a0
3
+ metadata.gz: 1ad8dcba5563ab2a1db6279693b52ebb4d8317ab00b227e0ab48579010cf1042
4
+ data.tar.gz: dc3654811cb83405cbf9e432f73392784be9da9a2bd7435b9cf5107553592bf2
5
5
  SHA512:
6
- metadata.gz: acc02947f862c3de0dd2122a44438fee340398d091a9066eab33e8929e153f545b385f906c3831185760d90afefe6e0c2f6464f5357c8ba185e617833f1ff6d8
7
- data.tar.gz: 97843f126f57e6ce43e75c3d7f9a6658acd2b3b74b805fee08561f0e57ad55664bcb1f5e95cbad2f920dd927ec0d04e71b20ebde5e628ec6ba28ff729010ba01
6
+ metadata.gz: 8735eda8760bb4370c8b5706e50973b221023d5dd066cb3aba31b005c23c752933e874826b216d1fad084793c7f321755f10d707e23fb9077db9df7940fc8beb
7
+ data.tar.gz: eceee9b80a5409b234ff876e5733ca5d9b375793a6fef0e755b334003d8794fbc39c68c216c9f8da1f69e06a7a5915b2a59bc82277b3c77f73432ffac89d6411
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sendly (3.13.0)
4
+ sendly (3.13.1)
5
5
  faraday (~> 2.0)
6
6
  faraday-retry (~> 2.0)
7
7
 
@@ -75,7 +75,8 @@ module Sendly
75
75
 
76
76
  class CampaignPreview
77
77
  attr_reader :id, :recipient_count, :estimated_segments, :estimated_credits,
78
- :current_balance, :has_enough_credits, :breakdown
78
+ :current_balance, :has_enough_credits, :breakdown,
79
+ :blocked_count, :sendable_count, :warnings, :messaging_profile
79
80
 
80
81
  def initialize(data)
81
82
  @id = data["id"]
@@ -85,6 +86,10 @@ module Sendly
85
86
  @current_balance = data["current_balance"] || data["currentBalance"] || 0
86
87
  @has_enough_credits = data["has_enough_credits"] || data["hasEnoughCredits"] || false
87
88
  @breakdown = data["breakdown"]
89
+ @blocked_count = data["blocked_count"] || data["blockedCount"]
90
+ @sendable_count = data["sendable_count"] || data["sendableCount"]
91
+ @warnings = data["warnings"]
92
+ @messaging_profile = data["messaging_profile"] || data["messagingProfile"]
88
93
  end
89
94
 
90
95
  def enough_credits?
@@ -185,5 +185,27 @@ module Sendly
185
185
  def delete(id)
186
186
  @client.delete("/contacts/#{id}")
187
187
  end
188
+
189
+ def import_contacts(contacts, list_id: nil, opted_in_at: nil)
190
+ body = {
191
+ contacts: contacts.map { |c|
192
+ h = { phone: c[:phone] }
193
+ h[:name] = c[:name] if c[:name]
194
+ h[:email] = c[:email] if c[:email]
195
+ h[:optedInAt] = c[:opted_in_at] if c[:opted_in_at]
196
+ h
197
+ }
198
+ }
199
+ body[:listId] = list_id if list_id
200
+ body[:optedInAt] = opted_in_at if opted_in_at
201
+
202
+ response = @client.post("/contacts/import", body)
203
+ {
204
+ imported: response["imported"],
205
+ skipped_duplicates: response["skippedDuplicates"],
206
+ errors: response["errors"] || [],
207
+ total_errors: response["totalErrors"] || 0
208
+ }
209
+ end
188
210
  end
189
211
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sendly
4
- VERSION = "3.13.0"
4
+ VERSION = "3.13.1"
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.13.0
4
+ version: 3.13.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-01-29 00:00:00.000000000 Z
11
+ date: 2026-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday