paubox_rails 1.0.0 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efb96c5633f721a96323beab83ed91499817cc05e7e740da733d2ea3db907988
4
- data.tar.gz: 766ce4809c4a6a74dee3c9614ec50407f8daa04351b00c6b5834126b1a9b7eb3
3
+ metadata.gz: f68c141779c45bbf28b520f210535ef3ff6abe9535925b631256f3c582f1cc85
4
+ data.tar.gz: b1f1e5e738b0c4b4b0f1dc459302e9caf04de4c8d39fccb10e50777714e81fc8
5
5
  SHA512:
6
- metadata.gz: bd37d1a222575dafaae87e3afd92fe5dd54874778c1dff2ec2ae00a78ad42278873e509d3ec00eeb5616416434d7a74f6cd25593e1f472dc565bb9d33c805e83
7
- data.tar.gz: bb9f9c170c09bb5aa043db76acdece25fb1a4bf089f11b2e3ecde245408ea88663718e8e2480b4befd1d7c892a7c9b1507567efda15ead0d6febe5a7d3752a60
6
+ metadata.gz: 15998c19e36e66f59e0c0e7152d445e42d61d33cff4627375b66a07f7e1f0fe0aa50d16fc3d8366beef487045e5df2b4f5dec87f90177a1efe7f5c624c30794a
7
+ data.tar.gz: af6a73ed219c68acf1fbb58d05f9a827f49e9ed6e97d4e9c5274a4058b6330f58e96973f24df65156a195e5c03367257e32962c9d55ab8c179e02c42e9c56184
@@ -0,0 +1,43 @@
1
+ #!/bin/sh
2
+ # Probes each base URL with a junk token: api.paubox.com answers unrouted paths
3
+ # with its own HTML 404 page, so a wrong base fails here without credentials.
4
+ #
5
+ # Usage: route-check.sh <url> [url ...]
6
+ # <command printing one URL per line> | route-check.sh
7
+ set -eu
8
+
9
+ MARKER='The resource could not be found'
10
+ TOKEN='route-check-not-a-real-key'
11
+
12
+ urls=$(mktemp)
13
+ fails=$(mktemp)
14
+ trap 'rm -f "$urls" "$fails"' EXIT
15
+
16
+ if [ "$#" -gt 0 ]; then
17
+ for u in "$@"; do echo "$u"; done > "$urls"
18
+ else
19
+ cat > "$urls"
20
+ fi
21
+
22
+ sed 's#/*$##' "$urls" | grep '^https://' | sort -u > "$urls.clean" || true
23
+ mv "$urls.clean" "$urls"
24
+
25
+ if [ ! -s "$urls" ]; then
26
+ echo "route-check: no URLs given" >&2
27
+ exit 1
28
+ fi
29
+
30
+ while IFS= read -r url; do
31
+ if curl -sS -m 20 -H "Authorization: Token token=$TOKEN" "$url" \
32
+ | grep -qF "$MARKER"; then
33
+ echo "FAIL $url <- not routed"
34
+ echo "$url" >> "$fails"
35
+ else
36
+ echo "ok $url"
37
+ fi
38
+ done < "$urls"
39
+
40
+ if [ -s "$fails" ]; then
41
+ echo "See https://docs.paubox.com for the documented base URLs." >&2
42
+ exit 1
43
+ fi
@@ -40,3 +40,14 @@ jobs:
40
40
 
41
41
  - name: Assert the suite actually executed
42
42
  run: ruby .github/scripts/assert_specs_ran.rb rspec-results.json
43
+
44
+ route-check:
45
+ name: Base URLs are routed
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+
50
+ - name: Probe the Forms base URL the client uses
51
+ run: |
52
+ grep -hoE 'https://api\.paubox\.com[a-zA-Z0-9/_.-]*' lib/paubox_rails/forms.rb \
53
+ | .github/scripts/route-check.sh
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.0.0"
2
+ ".": "1.1.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.1.0](https://github.com/Paubox/paubox-rails/compare/v1.0.0...v1.1.0) (2026-09-10)
6
+
7
+
8
+ ### Features
9
+
10
+ * add scheduled send support ([#23](https://github.com/Paubox/paubox-rails/issues/23)) ([f60f3e6](https://github.com/Paubox/paubox-rails/commit/f60f3e6d640631202273cba7c8ac6150f13f4752))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * target the documented /v1/forms base URL ([#20](https://github.com/Paubox/paubox-rails/issues/20)) ([0bf2abf](https://github.com/Paubox/paubox-rails/commit/0bf2abf715f5e6b365b59cdb9f3003bf76467060))
16
+
5
17
  ## [1.0.0](https://github.com/Paubox/paubox-rails/compare/v0.1.6...v1.0.0) (2026-08-21)
6
18
 
7
19
  First stable release. RubyGems had been on `0.1.6` since September 2021.
data/CLAUDE.md CHANGED
@@ -35,7 +35,7 @@ paubox-rails
35
35
  ├── Email path
36
36
  │ ActionMailer → Mail::Paubox (from paubox gem) → RestClient → api.paubox.com
37
37
  └── Forms path
38
- PauboxRails::Forms::Client → Net::HTTP → api.paubox.com/forms
38
+ PauboxRails::Forms::Client → Net::HTTP → api.paubox.com/v1/forms
39
39
  ```
40
40
 
41
41
  - Email credentials (`api_key`) are configured via `Paubox.configure`.
data/README.md CHANGED
@@ -74,6 +74,37 @@ class UserMailer < ApplicationMailer
74
74
  end
75
75
  ```
76
76
 
77
+ ## Scheduled send
78
+
79
+ Schedule messages for future delivery using `Paubox::Client` directly. The scheduled send methods are provided by the [Paubox Ruby gem](https://github.com/Paubox/paubox-ruby), which this gem depends on.
80
+
81
+ ```ruby
82
+ client = Paubox::Client.new
83
+
84
+ message = Paubox::Message.new(
85
+ from: 'sender@yourdomain.com',
86
+ to: ['recipient@example.com'],
87
+ subject: 'Scheduled message',
88
+ text_content: 'This will be delivered later.'
89
+ )
90
+
91
+ # Schedule a message
92
+ response = client.schedule_mail(message, '2025-12-25T15:00:00Z')
93
+ puts response['sourceTrackingId']
94
+
95
+ # Check status
96
+ status = client.get_scheduled(response['sourceTrackingId'])
97
+ puts status['state'] # "pending", "sent", "cancelled"
98
+
99
+ # Reschedule
100
+ client.reschedule(response['sourceTrackingId'], '2025-12-26T10:00:00Z')
101
+
102
+ # Cancel
103
+ client.cancel_scheduled(response['sourceTrackingId'])
104
+ ```
105
+
106
+ `scheduled_at` must be an ISO 8601 UTC datetime string in the future and within 30 days.
107
+
77
108
  ## Paubox Forms
78
109
 
79
110
  The gem includes a client for the [Paubox Forms API](https://docs.paubox.com/forms). The respondent-facing endpoints (fetching a form definition and submitting a response) are **public** — no API key or authentication is required. The form management endpoints (listing, creating, updating, exporting submissions, etc.) require a **scoped API key** — see [Authenticated usage](#authenticated-usage-form-management) below.
data/api.md CHANGED
@@ -9,7 +9,7 @@ This document covers the API endpoints exposed by `paubox-rails`. The gem wraps
9
9
 
10
10
  ## Forms API
11
11
 
12
- **Base URL:** `https://api.paubox.com/forms`
12
+ **Base URL:** `https://api.paubox.com/v1/forms`
13
13
 
14
14
  ### Authentication
15
15
 
@@ -2,7 +2,7 @@ require 'paubox_rails/forms/client'
2
2
 
3
3
  module PauboxRails
4
4
  module Forms
5
- BASE_URL = 'https://api.paubox.com/forms'.freeze
5
+ BASE_URL = 'https://api.paubox.com/v1/forms'.freeze
6
6
 
7
7
  class Error < StandardError; end
8
8
  class NotFoundError < Error; end
@@ -1,3 +1,3 @@
1
1
  module PauboxRails
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paubox_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paubox, Inc.
@@ -102,6 +102,7 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".github/scripts/assert_specs_ran.rb"
105
+ - ".github/scripts/route-check.sh"
105
106
  - ".github/workflows/ci.yml"
106
107
  - ".github/workflows/pr-title.yml"
107
108
  - ".github/workflows/release-please.yml"