pylon-api 1.1.1 → 1.2.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/CHANGELOG.md +10 -0
- data/README.md +17 -7
- data/lib/pylon/client.rb +24 -1
- data/lib/pylon/models/email_suppression.rb +13 -0
- data/lib/pylon/version.rb +2 -2
- data/lib/pylon.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae2b3657a71f50dfe1fbe13af8222fd19fb8026356543cae2b9372bb12bee3fa
|
|
4
|
+
data.tar.gz: 5232f1d4a792a6d06bf847ce5170bd4272166b7c47700f50929f676319dd0b88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d87c185ffa7b4657a9daaa49e87aa1e03b17913c2c65601270f076165902b1689b7c1e02a0142bfb26a10c751507987547fc49658848104e965861d454ba5fc
|
|
7
|
+
data.tar.gz: 0fc12093a40563fbb376d6cd84dcf90dfdcd3e359702ab1f99cf750c1b458436a8ccd806d4d9089d42afaadeffeec1a36b25a3faaae290f4f32ee92145fc567e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.2.0] - 2026-09-20
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `list_email_suppressions` for `GET /email-suppressions` with optional `email`, `cursor`, and `limit` query parameters. Pass `email` to check a single address; an empty collection means it is not suppressed.
|
|
7
|
+
- `delete_email_suppression` for `DELETE /email-suppressions/{id}`
|
|
8
|
+
- `Pylon::Models::EmailSuppression` model (`id`, `email`, `reason`, `created_at`, `bounce_details`)
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Documentation only: README examples now use `body_html` when creating issues and note the 365-day window for `list_issues`. No existing method signatures, paths, or return types changed.
|
|
12
|
+
|
|
3
13
|
## [1.1.1] - 2025-04-18
|
|
4
14
|
|
|
5
15
|
### Fixed
|
data/README.md
CHANGED
|
@@ -55,25 +55,35 @@ account, response = client.get_account('account_id')
|
|
|
55
55
|
#### Issues
|
|
56
56
|
|
|
57
57
|
```ruby
|
|
58
|
-
# List issues (requires time range, max
|
|
58
|
+
# List issues (requires time range, max 365 days)
|
|
59
59
|
start_time = Time.now.utc - 86400 # 24 hours ago
|
|
60
60
|
end_time = Time.now.utc
|
|
61
61
|
|
|
62
|
-
issues
|
|
62
|
+
issues = client.list_issues(
|
|
63
63
|
start_time: start_time.strftime("%Y-%m-%dT%H:%M:%SZ"),
|
|
64
64
|
end_time: end_time.strftime("%Y-%m-%dT%H:%M:%SZ"),
|
|
65
65
|
page: 1,
|
|
66
|
-
per_page: 20
|
|
67
|
-
status: 'open' # optional filter
|
|
66
|
+
per_page: 20
|
|
68
67
|
)
|
|
69
68
|
|
|
70
|
-
# Create an issue
|
|
71
|
-
issue
|
|
69
|
+
# Create an issue (title and body_html are required by the API)
|
|
70
|
+
issue = client.create_issue(
|
|
72
71
|
title: 'New Issue',
|
|
73
|
-
|
|
72
|
+
body_html: '<p>Issue description</p>',
|
|
73
|
+
requester_email: 'customer@example.com'
|
|
74
74
|
)
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
#### Email Suppressions
|
|
78
|
+
|
|
79
|
+
```ruby
|
|
80
|
+
# Check whether a single address is suppressed (empty collection means not suppressed)
|
|
81
|
+
suppressions = client.list_email_suppressions(email: 'user@example.com')
|
|
82
|
+
|
|
83
|
+
# Remove a suppression
|
|
84
|
+
client.delete_email_suppression(suppressions.first.id) unless suppressions.size.zero?
|
|
85
|
+
```
|
|
86
|
+
|
|
77
87
|
#### Teams
|
|
78
88
|
|
|
79
89
|
```ruby
|
data/lib/pylon/client.rb
CHANGED
|
@@ -152,7 +152,30 @@ module Pylon
|
|
|
152
152
|
post("/custom_fields", body: params)
|
|
153
153
|
end
|
|
154
154
|
|
|
155
|
-
#
|
|
155
|
+
# List email suppressions, most recently suppressed first
|
|
156
|
+
#
|
|
157
|
+
# Pass +email+ to check a single address. An empty collection means the
|
|
158
|
+
# address is not suppressed. Uses the API's cursor-based pagination.
|
|
159
|
+
#
|
|
160
|
+
# @param email [String, nil] Only return the suppression for this address, if one exists
|
|
161
|
+
# @param cursor [String, nil] Cursor for the next page of results
|
|
162
|
+
# @param limit [Integer, nil] Number of suppressions to fetch (API default 100, max 1000)
|
|
163
|
+
# @return [Models::Collection<Models::EmailSuppression>] Collection of email suppression objects
|
|
164
|
+
def list_email_suppressions(email: nil, cursor: nil, limit: nil)
|
|
165
|
+
query = { email: email, cursor: cursor, limit: limit }.compact
|
|
166
|
+
get("/email-suppressions", query: query,
|
|
167
|
+
model_class: Models::EmailSuppression, collection: true)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Remove an email suppression so Pylon resumes sending to the address
|
|
171
|
+
#
|
|
172
|
+
# @param suppression_id [String] The ID of the email suppression to remove
|
|
173
|
+
# @return [Array(Hash, Faraday::Response)] Response data and raw response
|
|
174
|
+
def delete_email_suppression(suppression_id)
|
|
175
|
+
delete("/email-suppressions/#{suppression_id}")
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Lists issues within a specified time range (max 365 days)
|
|
156
179
|
#
|
|
157
180
|
# @param start_time [String] Start time in RFC3339 format
|
|
158
181
|
# @param end_time [String] End time in RFC3339 format
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pylon
|
|
4
|
+
module Models
|
|
5
|
+
# An email address Pylon will not send to, either because a message
|
|
6
|
+
# hard bounced or because someone suppressed it manually.
|
|
7
|
+
#
|
|
8
|
+
# Attributes: id, email, reason ("hard_bounce" or "manual"),
|
|
9
|
+
# created_at (RFC3339), bounce_details
|
|
10
|
+
class EmailSuppression < Base
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
data/lib/pylon/version.rb
CHANGED
data/lib/pylon.rb
CHANGED
|
@@ -17,6 +17,7 @@ require_relative "pylon/models/attachment"
|
|
|
17
17
|
require_relative "pylon/models/contact"
|
|
18
18
|
require_relative "pylon/models/ticket_form"
|
|
19
19
|
require_relative "pylon/models/article"
|
|
20
|
+
require_relative "pylon/models/email_suppression"
|
|
20
21
|
require_relative "pylon/client"
|
|
21
22
|
|
|
22
23
|
module Pylon
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pylon-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Odom
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-09-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -140,6 +140,7 @@ files:
|
|
|
140
140
|
- lib/pylon/models/base.rb
|
|
141
141
|
- lib/pylon/models/collection.rb
|
|
142
142
|
- lib/pylon/models/contact.rb
|
|
143
|
+
- lib/pylon/models/email_suppression.rb
|
|
143
144
|
- lib/pylon/models/issue.rb
|
|
144
145
|
- lib/pylon/models/tag.rb
|
|
145
146
|
- lib/pylon/models/team.rb
|