smailer 0.8.1 → 0.8.2

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
  SHA1:
3
- metadata.gz: 6bf1b2eaf8471b07434e71803ce46eb6d971ad81
4
- data.tar.gz: 3c761ccfcf13f68a90d57590c541e3935b6895dd
3
+ metadata.gz: 597184be6e340a90a5aec0c7d877ebaeae878071
4
+ data.tar.gz: be0274a57ca1f64b01398ca45b2bab0ae770aba5
5
5
  SHA512:
6
- metadata.gz: 6b98a822ebfcce95f8ece649ed0b99a3522dc8e2c924e7fa8faf8f55f706bc8d97cc55d15e54b5b83c13877f07dcb0393ec8b5437644137d07721b40a0d3389f
7
- data.tar.gz: 58cde2ebfc9c01c7d2d5d36655e50143f815157a9c72c51ef21c98318081f1d061d9c8be48474bab319d1787624f2742e72f54ea3be4e03870259c357d128294
6
+ metadata.gz: 34a053d61e746507658a348e6f2f59a0d82a49b5e7ddae10648f5f9399f5a24fa7d9a3fc4c6e09db24beac000bcea155d8a9c62a70851d898377667c3711c779
7
+ data.tar.gz: 9747adc90ed4c575516df92f07aae7edc7a943b882d34e50d66c6cf1e0891720a252f1eeeb0cef4736501475b350936092126c12b063a086f5120f8330f8ae06
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -1,11 +1,24 @@
1
+ ## Version v0.8.2
2
+
3
+ - Fixes broken unsubscribe and tracking links (broken by improper unique
4
+ message key regeneration). The issue was introduced in v0.8.0.
5
+
6
+ No special actions are required to upgrade from v0.8.1.
7
+
1
8
  ## Version v0.8.1
2
9
 
3
10
  - Adds support for 'reply-to'
4
11
 
5
12
  **Major Bug Fixes:**
6
13
 
7
- - `QueuedMail.new(to: …, from: …, mail_campaign: …)` will work as expected 9ff2d80
8
- - `QueuedMail#body_text=` now works as expected
14
+ - `QueuedMail.new(to: …, from: …, mail_campaign: …)` will work as expected [9ff2d80](https://github.com/livebg/smailer/commit/9ff2d80).
15
+ - `QueuedMail#body_text=` now works as expected.
16
+
17
+ **Upgrading from v0.8.0 to v0.8.1**
18
+
19
+ To make the required changes in the database, you can use this
20
+ [smailer_v0_8_0_to_v0_8_1 migration](upgrading/migrations/smailer_v0_8_0_to_v0_8_1.rb).
21
+ You may need to alter this migration to fit your data.
9
22
 
10
23
  ## Version v0.8.0
11
24
 
@@ -94,7 +94,7 @@ module Smailer
94
94
  end
95
95
 
96
96
  def initialize_message_key
97
- self.key = Digest::MD5.hexdigest("#{mail_campaign_id}, #{to}, #{SecureRandom.hex(15)} and #{id} compose this key.")
97
+ self.key = self[:key] || Digest::MD5.hexdigest("#{mail_campaign_id}, #{to}, #{SecureRandom.hex(15)} compose this key.")
98
98
  end
99
99
 
100
100
  def interpolate(text)
@@ -1,7 +1,7 @@
1
1
  module Smailer
2
2
  MAJOR = 0
3
3
  MINOR = 8
4
- PATCH = 1
4
+ PATCH = 2
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
@@ -150,6 +150,22 @@ describe Smailer::Models::QueuedMail do
150
150
 
151
151
  expect(queued_mail_1.key).to_not eq(queued_mail_2.key)
152
152
  end
153
+
154
+ it 'remains the same once initialized' do
155
+ queued_mail = Smailer::Models::QueuedMail.new
156
+ queued_mail.mail_campaign_id = 42
157
+ queued_mail.to = 'test@example.com'
158
+
159
+ expect(SecureRandom).to receive(:hex).once.with(15).and_return('random-string')
160
+ expect(Digest::MD5).to receive(:hexdigest).once.with('42, test@example.com, random-string compose this key.').and_return('message-key')
161
+
162
+ expect(queued_mail.key).to eq('message-key')
163
+
164
+ queued_mail.save!
165
+ queued_mail.reload
166
+
167
+ expect(queued_mail.key).to eq('message-key')
168
+ end
153
169
  end
154
170
 
155
171
  describe '#require_uniqueness' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitar Dimitrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-06 00:00:00.000000000 Z
11
+ date: 2015-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,6 +61,7 @@ extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
+ - ".rspec"
64
65
  - CHANGELOG.md
65
66
  - Gemfile
66
67
  - Gemfile.lock