mailkick 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/controllers/mailkick/subscriptions_controller.rb +10 -4
- data/lib/mailkick/engine.rb +1 -1
- data/lib/mailkick/processor.rb +1 -1
- data/lib/mailkick/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35835a6f8e9f1d62977205c3b4b381dc13baecf7
|
4
|
+
data.tar.gz: 528cb1cf61a126560de37a2b6dabccc6bc56283a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 635af4e2bfdb8d2dab9c70f2f7f9d5a88c903d42882b9234455d3bc82c7896bd5bb7521a7209b714b2795e7798ad01a2d5f7db40da99ba9cdd00d4c2560931e2
|
7
|
+
data.tar.gz: dd7bc1dad73ea07ebead206ceba06a48b5a9989f2691f911f238cc2ba33355bc67c5ea8c08885ccae184acbe01062bcbb40a3075924f9e924ba1fd0acdab203a
|
data/CHANGELOG.md
CHANGED
@@ -7,12 +7,12 @@ module Mailkick
|
|
7
7
|
|
8
8
|
def unsubscribe
|
9
9
|
Mailkick.opt_out(@options)
|
10
|
-
redirect_to subscription_path(
|
10
|
+
redirect_to subscription_path(url_token)
|
11
11
|
end
|
12
12
|
|
13
13
|
def subscribe
|
14
14
|
Mailkick.opt_in(@options)
|
15
|
-
redirect_to subscription_path(
|
15
|
+
redirect_to subscription_path(url_token)
|
16
16
|
end
|
17
17
|
|
18
18
|
protected
|
@@ -41,14 +41,20 @@ module Mailkick
|
|
41
41
|
helper_method :opted_out?
|
42
42
|
|
43
43
|
def subscribe_url
|
44
|
-
subscribe_subscription_path(
|
44
|
+
subscribe_subscription_path(url_token)
|
45
45
|
end
|
46
46
|
helper_method :subscribe_url
|
47
47
|
|
48
48
|
def unsubscribe_url
|
49
|
-
unsubscribe_subscription_path(
|
49
|
+
unsubscribe_subscription_path(url_token)
|
50
50
|
end
|
51
51
|
helper_method :unsubscribe_url
|
52
52
|
|
53
|
+
private
|
54
|
+
|
55
|
+
def url_token
|
56
|
+
@url_token ||= CGI::escape(params[:id])
|
57
|
+
end
|
58
|
+
|
53
59
|
end
|
54
60
|
end
|
data/lib/mailkick/engine.rb
CHANGED
@@ -5,7 +5,7 @@ module Mailkick
|
|
5
5
|
initializer "mailkick" do |app|
|
6
6
|
Mailkick.discover_services
|
7
7
|
secrets = app.respond_to?(:secrets) ? app.secrets : app.config
|
8
|
-
Mailkick.secret_token
|
8
|
+
Mailkick.secret_token ||= secrets.respond_to?(:secret_key_base) ? secrets.secret_key_base : secrets.secret_token
|
9
9
|
ActiveSupport.on_load :action_mailer do
|
10
10
|
helper Mailkick::UrlHelper
|
11
11
|
end
|
data/lib/mailkick/processor.rb
CHANGED
@@ -20,7 +20,7 @@ module Mailkick
|
|
20
20
|
|
21
21
|
parts = message.parts.any? ? message.parts : [message]
|
22
22
|
parts.each do |part|
|
23
|
-
part.body.raw_source.gsub!(/%7B%7BMAILKICK_TOKEN%7D%7D/, token)
|
23
|
+
part.body.raw_source.gsub!(/%7B%7BMAILKICK_TOKEN%7D%7D/, CGI::escape(token))
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
data/lib/mailkick/version.rb
CHANGED
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: 0.1.
|
4
|
+
version: 0.1.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:
|
11
|
+
date: 2015-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,9 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.4.5
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Email subscriptions made easy
|
97
97
|
test_files: []
|
98
|
-
has_rdoc:
|