mailkick 1.1.0 → 1.1.2

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: 29547fd14ea942978a05dce4e217a19095b3e60b32d4f3d0da658603d02b2ef1
4
- data.tar.gz: 5df27e5ebc7a4be7c60ea04251a78baaba22cf19d958a9043e0fdf30ec3760e2
3
+ metadata.gz: cb59432bb88208ad9818187d12da9be032d021e8c8e9e47635e15b4fe2aa7e6e
4
+ data.tar.gz: 10c2e216d3d9622bd770e4fdc1dcf5f4f0b84913edbb715698e56f6f2ac2d8d5
5
5
  SHA512:
6
- metadata.gz: d656f3001137374753348508afe6a86a226039a9fba1873fad479d6f6b8f43ecf79f59e28fca498a505ab7b8467b44863fe8b6866f13c305530bc497976f5f49
7
- data.tar.gz: 06b66e4eb5e9ba1705e8f62eaa3a953e8ff3fef54d65ca44ff6981313d36408e38533154258107cca82a8b02033772e311ee11be07e71dddb99a05be1bee2772
6
+ metadata.gz: 5d8280c3fbaa4dace1475bd68e5b938d2d7f6593a2b38d0afb77073fd3e49cc807792187470f59df812da5bc9dbe43685058540b9029a33dd93c2f8012a4a816
7
+ data.tar.gz: 1c49cec20083acacf9ef9441c7d5595de6311d82c95c2debb02461ae7b167d23a40d6845e9008fcb1c731cb77bd2c9489db22c7507471b9ee4b6d33b301875c1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
+ ## 1.1.2 (2023-02-07)
2
+
3
+ - Improved serialization
4
+
5
+ ## 1.1.1 (2023-01-30)
6
+
7
+ - Switched to JSON for serialization with non-default `secret_token`
8
+
1
9
  ## 1.1.0 (2023-01-29)
2
10
 
3
11
  - Improved secret token generation
12
+ - Switched to JSON for serialization with default `secret_token`
4
13
 
5
14
  ## 1.0.1 (2021-06-20)
6
15
 
data/README.md CHANGED
@@ -218,6 +218,7 @@ rails db:migrate
218
218
  - `User.not_opted_out` to `User.subscribed(list)`
219
219
  - `opt_in` to `subscribe(list)`
220
220
  - `opt_out` to `unsubscribe(list)`
221
+ - `opted_out?` to `!subscribed?(list)`
221
222
 
222
223
  3. Add a user and list to `mailkick_unsubscribe_url`
223
224
 
@@ -0,0 +1,15 @@
1
+ # need custom class due to
2
+ # https://github.com/rails/rails/issues/47185
3
+ module Mailkick
4
+ class Serializer
5
+ def self.dump(value)
6
+ ActiveSupport::JSON.encode(value)
7
+ end
8
+
9
+ def self.load(value)
10
+ ActiveSupport::JSON.decode(value)
11
+ rescue JSON::ParserError
12
+ Marshal.load(value)
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Mailkick
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.2"
3
3
  end
data/lib/mailkick.rb CHANGED
@@ -2,24 +2,26 @@
2
2
  require "active_support"
3
3
 
4
4
  # stdlib
5
+ require "json"
5
6
  require "set"
6
7
 
7
8
  # modules
8
- require "mailkick/legacy"
9
- require "mailkick/model"
10
- require "mailkick/service"
11
- require "mailkick/service/aws_ses"
12
- require "mailkick/service/mailchimp"
13
- require "mailkick/service/mailgun"
14
- require "mailkick/service/mandrill"
15
- require "mailkick/service/sendgrid"
16
- require "mailkick/service/sendgrid_v2"
17
- require "mailkick/service/postmark"
18
- require "mailkick/url_helper"
19
- require "mailkick/version"
9
+ require_relative "mailkick/legacy"
10
+ require_relative "mailkick/model"
11
+ require_relative "mailkick/serializer"
12
+ require_relative "mailkick/service"
13
+ require_relative "mailkick/service/aws_ses"
14
+ require_relative "mailkick/service/mailchimp"
15
+ require_relative "mailkick/service/mailgun"
16
+ require_relative "mailkick/service/mandrill"
17
+ require_relative "mailkick/service/sendgrid"
18
+ require_relative "mailkick/service/sendgrid_v2"
19
+ require_relative "mailkick/service/postmark"
20
+ require_relative "mailkick/url_helper"
21
+ require_relative "mailkick/version"
20
22
 
21
23
  # integrations
22
- require "mailkick/engine" if defined?(Rails)
24
+ require_relative "mailkick/engine" if defined?(Rails)
23
25
 
24
26
  module Mailkick
25
27
  mattr_accessor :services, :mount, :process_opt_outs_method
@@ -44,10 +46,8 @@ module Mailkick
44
46
  @@message_verifier = nil
45
47
  end
46
48
 
47
- # TODO use JSON serializer
48
- # can't currently rotate serializer without rotating token or digest
49
49
  def self.message_verifier
50
- @@message_verifier ||= ActiveSupport::MessageVerifier.new(Mailkick.secret_token)
50
+ @@message_verifier ||= ActiveSupport::MessageVerifier.new(Mailkick.secret_token, serializer: Serializer)
51
51
  end
52
52
 
53
53
  def self.generate_token(subscriber, list)
@@ -58,7 +58,7 @@ module Mailkick
58
58
  end
59
59
  end
60
60
 
61
- ActiveSupport.on_load :action_mailer do
61
+ ActiveSupport.on_load(:action_mailer) do
62
62
  helper Mailkick::UrlHelper
63
63
  end
64
64
 
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.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-30 00:00:00.000000000 Z
11
+ date: 2023-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -45,6 +45,7 @@ files:
45
45
  - lib/mailkick/engine.rb
46
46
  - lib/mailkick/legacy.rb
47
47
  - lib/mailkick/model.rb
48
+ - lib/mailkick/serializer.rb
48
49
  - lib/mailkick/service.rb
49
50
  - lib/mailkick/service/aws_ses.rb
50
51
  - lib/mailkick/service/mailchimp.rb
@@ -74,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
75
  - !ruby/object:Gem::Version
75
76
  version: '0'
76
77
  requirements: []
77
- rubygems_version: 3.4.1
78
+ rubygems_version: 3.4.6
78
79
  signing_key:
79
80
  specification_version: 4
80
81
  summary: Email subscriptions for Rails