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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sendly/campaigns_resource.rb +6 -1
- data/lib/sendly/contacts_resource.rb +22 -0
- 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: 1ad8dcba5563ab2a1db6279693b52ebb4d8317ab00b227e0ab48579010cf1042
|
|
4
|
+
data.tar.gz: dc3654811cb83405cbf9e432f73392784be9da9a2bd7435b9cf5107553592bf2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8735eda8760bb4370c8b5706e50973b221023d5dd066cb3aba31b005c23c752933e874826b216d1fad084793c7f321755f10d707e23fb9077db9df7940fc8beb
|
|
7
|
+
data.tar.gz: eceee9b80a5409b234ff876e5733ca5d9b375793a6fef0e755b334003d8794fbc39c68c216c9f8da1f69e06a7a5915b2a59bc82277b3c77f73432ffac89d6411
|
data/Gemfile.lock
CHANGED
|
@@ -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
|
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.13.
|
|
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
|
|
11
|
+
date: 2026-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|