mailkick 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9cc5e031a75a29b20c985acb8b16922338dab5e65a1df97818facd9a94c75e3
4
- data.tar.gz: 433257564c2918ad55eeb41efc5219e86720d2d29bca3808ff084ba76a085524
3
+ metadata.gz: 6a9bd60adb2d9f1ce219b451369a4c5547f3dea808fa3123e31fb317fccfe843
4
+ data.tar.gz: 9fab1707325fdc093ddc9123c94d331d6c7b4b17ceaae1d5f8760cdb30b4f74b
5
5
  SHA512:
6
- metadata.gz: 1c28e41447543e5498ca2f91fa66e1e0cf1dce16160d76d73b883be236f8a5d36091c2e768d3f5668702a371759891e1a3a5187f4a440cb35b313f9021734908
7
- data.tar.gz: 1fe58111dc7a26644d68a425be18824a660cf16c4305207c8b63ae8916609381d376a72bd449b4e21b02fe1541e571a210b0086d7947b764e619ed67a3f8a5dd
6
+ metadata.gz: 8f1160fff3f3ef81e4ff3d2ab9fae04076e84db93f95ab17f1655a99185331c22783c262dac0433484575371bebedc05750744a1434fdfa6f9d32cac87609050
7
+ data.tar.gz: f0cfecb317f7fc74848ec9479248f635f268194bfd9d4c38ecda06cb3ec9815eb9c17d8b9044ca38ca0dd459a5e3fe9d8acfefd3d7953ded84b132bb5286a9ff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3.1 (2024-09-09)
2
+
3
+ - Fixed deprecation warning with Rails 7.1
4
+
1
5
  ## 1.3.0 (2024-01-18)
2
6
 
3
7
  - Added support for one-click unsubscribe headers (RFC 8058)
data/README.md CHANGED
@@ -7,7 +7,7 @@ Email subscriptions for Rails
7
7
 
8
8
  :postbox: Check out [Ahoy Email](https://github.com/ankane/ahoy_email) for analytics
9
9
 
10
- [![Build Status](https://github.com/ankane/mailkick/workflows/build/badge.svg?branch=master)](https://github.com/ankane/mailkick/actions)
10
+ [![Build Status](https://github.com/ankane/mailkick/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/mailkick/actions)
11
11
 
12
12
  ## Installation
13
13
 
@@ -209,68 +209,6 @@ Access the subscription model directly
209
209
  Mailkick::Subscription.all
210
210
  ```
211
211
 
212
- ## Upgrading
213
-
214
- ### 1.0
215
-
216
- Mailkick 1.0 stores subscriptions instead of opt-outs. To migrate:
217
-
218
- 1. Add a table to store subscriptions
219
-
220
- ```sh
221
- rails generate mailkick:install
222
- rails db:migrate
223
- ```
224
-
225
- 2. Change the following methods in your code:
226
-
227
- - `mailkick_user` to `has_subscriptions`
228
- - `User.not_opted_out` to `User.subscribed(list)`
229
- - `opt_in` to `subscribe(list)`
230
- - `opt_out` to `unsubscribe(list)`
231
- - `opted_out?` to `!subscribed?(list)`
232
-
233
- 3. Add a user and list to `mailkick_unsubscribe_url`
234
-
235
- ```ruby
236
- mailkick_unsubscribe_url(user, list)
237
- ```
238
-
239
- 4. Migrate data for each of your lists
240
-
241
- ```ruby
242
- opted_out_emails = Mailkick::Legacy.opted_out_emails(list: nil)
243
- opted_out_users = Mailkick::Legacy.opted_out_users(list: nil)
244
-
245
- User.find_in_batches do |users|
246
- users.reject! { |u| opted_out_emails.include?(u.email) }
247
- users.reject! { |u| opted_out_users.include?(u) }
248
-
249
- now = Time.now
250
- records =
251
- users.map do |user|
252
- {
253
- subscriber_type: user.class.name,
254
- subscriber_id: user.id,
255
- list: "sales",
256
- created_at: now,
257
- updated_at: now
258
- }
259
- end
260
-
261
- # use create! for Active Record < 6
262
- Mailkick::Subscription.insert_all!(records)
263
- end
264
- ```
265
-
266
- 5. Drop the `mailkick_opt_outs` table
267
-
268
- ```ruby
269
- drop_table :mailkick_opt_outs
270
- ```
271
-
272
- Also, if you use `Mailkick.fetch_opt_outs`, [add a method](#bounces-and-spam-reports) to handle opt outs.
273
-
274
212
  ## History
275
213
 
276
214
  View the [changelog](https://github.com/ankane/mailkick/blob/master/CHANGELOG.md)
@@ -13,7 +13,7 @@ module Mailkick
13
13
  creds =
14
14
  if app.respond_to?(:credentials) && app.credentials.secret_key_base
15
15
  app.credentials
16
- elsif app.respond_to?(:secrets)
16
+ elsif app.respond_to?(:secrets) && (Rails::VERSION::STRING.to_f < 7.1 || app.config.paths["config/secrets"].existent.any?)
17
17
  app.secrets
18
18
  else
19
19
  app.config
@@ -3,7 +3,7 @@ module Mailkick
3
3
  def has_subscriptions
4
4
  class_eval do
5
5
  has_many :mailkick_subscriptions, class_name: "Mailkick::Subscription", as: :subscriber
6
- scope :subscribed, -> (list) { joins(:mailkick_subscriptions).where(mailkick_subscriptions: {list: list}) }
6
+ scope :subscribed, ->(list) { joins(:mailkick_subscriptions).where(mailkick_subscriptions: {list: list}) }
7
7
 
8
8
  def subscribe(list)
9
9
  mailkick_subscriptions.where(list: list).first_or_create!
@@ -6,7 +6,7 @@ module Mailkick
6
6
  REASONS_MAP = {
7
7
  "SpamNotification" => "spam",
8
8
  "SpamComplaint" => "spam",
9
- "Unsubscribe" => "unsubscribe",
9
+ "Unsubscribe" => "unsubscribe"
10
10
  }
11
11
 
12
12
  def initialize(options = {})
@@ -1,3 +1,3 @@
1
1
  module Mailkick
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-19 00:00:00.000000000 Z
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 3.5.3
78
+ rubygems_version: 3.5.16
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Email subscriptions for Rails