ahoy_email 3.0.0 → 4.0.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: d7ace81db2d79de0385596b9cc076ce32f7ead8b0ac96f18be9d4df728814332
4
- data.tar.gz: 2cf40755b20d6acf97e1d5d88d1b58da2d0de85647bd34f02c734ae2366275fa
3
+ metadata.gz: bd188dfb55eeecb5ff5b601ab679f04df570515a2176af9184192ea0cd8688bc
4
+ data.tar.gz: 176f9e44b50fc890e29d522e80bc68143739fcd5c14235977ec8c1f258d84043
5
5
  SHA512:
6
- metadata.gz: 7f7051e5893e5a489cacb2f3b76f238fb448d1065ba3fe12c02b36b89515bd591b42243ccb03e9a056b7d64f2c1a8da558d2c25135dab2db5a202261ac81f24b
7
- data.tar.gz: ec4ece8d9c5becd279980fc72c3fe046a20a8305b41eb7df8fc9fc0cc61e8ff29dc3f0020dc929332a9551bcb13a3d569c95f2a7f277ae5f695224a656b972bf
6
+ metadata.gz: 6b375f8a1fbb1d78e6bf87b7092c40484ea889f3d71a7f9d2d7916e365161edb229e947aea7f2db517a430775cfc7b29881223efd00391232bb3cea7a859f4e3
7
+ data.tar.gz: c9fb82f641e3905f7039b81c6465df26a01d9ddc529a25e600d966eb58b4ed96017e8ff6ae0e2d135a4f7545eb9a9a6eea297f8e6c56edb1e4a632b1926325fb
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
+ ## 4.0.0 (2026-08-08)
2
+
3
+ See the [upgrade notes](https://github.com/ankane/ahoy_email?tab=readme-ov-file#40)
4
+
5
+ - Fixed change to key generator hash digest class
6
+ - Removed support for Ruby < 3.3 and Rails < 7.2
7
+
1
8
  ## 3.0.0 (2025-07-02)
2
9
 
3
- See the [upgrade notes](https://github.com/ankane/ahoy_email?tab=readme-ov-file#30)
10
+ See the [upgrade notes](https://github.com/ankane/ahoy_email/blob/v3.0.0/README.md#upgrading)
4
11
 
5
12
  - Switched to HTML5 parsing by default (when available)
6
13
  - Removed support for legacy secret token generation
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  First-party email analytics for Rails
4
4
 
5
- **Ahoy Email 3.0 was recently released** - see [how to upgrade](#upgrading)
5
+ **Ahoy Email 4.0 was recently released** - see [how to upgrade](#upgrading)
6
6
 
7
7
  :fire: For web and native app analytics, check out [Ahoy](https://github.com/ankane/ahoy)
8
8
 
@@ -108,7 +108,7 @@ user.messages
108
108
  Add extra data to messages. Create a migration like:
109
109
 
110
110
  ```ruby
111
- class AddCouponIdToAhoyMessages < ActiveRecord::Migration[8.0]
111
+ class AddCouponIdToAhoyMessages < ActiveRecord::Migration[8.1]
112
112
  def change
113
113
  add_column :ahoy_messages, :coupon_id, :integer
114
114
  end
@@ -328,18 +328,12 @@ AhoyEmail.stats("my-campaign")
328
328
 
329
329
  ## Upgrading
330
330
 
331
- ### 3.0
331
+ ### 4.0
332
332
 
333
- Links that use click analytics created before version 2.3.0 (released June 2024) will no longer work by default. To restore support, [determine the previous secret token](https://github.com/ankane/ahoy_email/blob/v2.5.0/lib/ahoy_email/engine.rb#L11-L21) and create an initializer with:
333
+ Versions 2.3.0-3.0.0 cause applications to use SHA1 for the key generator hash digest class if `AhoyEmail.secret_token` is not manually set (due to [this behavior in Rails](https://github.com/rails/rails/issues/56736)). To avoid breakage when upgrading, add to `config/application.rb`:
334
334
 
335
335
  ```ruby
336
- AhoyEmail.secret_token = [AhoyEmail.secret_token, previous_secret_token]
337
- ```
338
-
339
- Also, Nokogiri’s HTML5 parser is now used to rewrite links for UTM tagging and click analytics when available. To use HTML4 parsing, create an initializer with:
340
-
341
- ```ruby
342
- AhoyEmail.default_options[:html5] = false
336
+ config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA1
343
337
  ```
344
338
 
345
339
  ## History
@@ -3,7 +3,8 @@ require "rails/engine"
3
3
  module AhoyEmail
4
4
  class Engine < ::Rails::Engine
5
5
  initializer "ahoy_email" do |app|
6
- AhoyEmail.secret_token ||= app.key_generator.generate_key("ahoy_email")
6
+ # avoid app.key_generator due to https://github.com/ankane/ahoy_email/pull/168
7
+ AhoyEmail.secret_token ||= ActiveSupport::KeyGenerator.new(app.secret_key_base, iterations: 1000, hash_digest_class: OpenSSL::Digest::SHA1).generate_key("ahoy_email")
7
8
  end
8
9
  end
9
10
  end
@@ -20,7 +20,7 @@ module AhoyEmail
20
20
  secret_tokens.any? do |secret_token|
21
21
  expected_signature =
22
22
  if legacy
23
- # TODO remove legacy support in 4.0
23
+ # TODO remove legacy support in 5.0
24
24
  OpenSSL::HMAC.hexdigest("SHA1", secret_token, url)
25
25
  else
26
26
  signature(token: token, campaign: campaign, url: url, secret_token: secret_token)
@@ -1,3 +1,3 @@
1
1
  module AhoyEmail
2
- VERSION = "3.0.0"
2
+ VERSION = "4.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahoy_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '7.1'
18
+ version: '7.2'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '7.1'
25
+ version: '7.2'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: addressable
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -113,14 +113,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '3.2'
116
+ version: '3.3'
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.6.7
123
+ rubygems_version: 4.0.16
124
124
  specification_version: 4
125
125
  summary: First-party email analytics for Rails
126
126
  test_files: []