govuk_notify_rails 2.1.0 → 2.1.1

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: 8c8cfae3d9c9ea680d58a9d24aafe725365a8542
4
- data.tar.gz: c9b21033bbbd27f9ce00b22aaee945cab02d3ea6
3
+ metadata.gz: a55b44fb41ce9a8181e520d458b520f34a13b27e
4
+ data.tar.gz: b94268997eb2b20737cfd0638ad3ce9caa9f4cfa
5
5
  SHA512:
6
- metadata.gz: efb994f4e8a918b16a8ec04f2015330d704bbf8a98f946a86158cb768fc462d577a925cd84a60644520a72601a912399a259d1167f5cb35d24a3f3cdca4e978b
7
- data.tar.gz: befa2a1f409c790dc98ee3c18a3befec69d60b05d901e7bdad0ead4f51d790075ceb1f406e7971e14f90cbfcfec772540fbff639a59e1a0135329e190acbea02
6
+ metadata.gz: c565ebd1876273e287a80bed5e5cb7b554f12ef0986b80294ac75e663407487862b32e42914f8a13f56bd573cea99be8dc9754706ab63f0724765dc84e8f904f
7
+ data.tar.gz: 7fffcf9985c3fbc78c0b922ea2c2cb78e2e8b948ff284a3ae6e322be61d10107fe59d710249a0807a04539e66d5ab0196bd841638db8aa7474b5ce5c354f788e
@@ -24,7 +24,8 @@ module GovukNotifyRails
24
24
  email_address: message.to.first,
25
25
  template_id: message.govuk_notify_template,
26
26
  reference: message.govuk_notify_reference,
27
- personalisation: message.govuk_notify_personalisation
27
+ personalisation: message.govuk_notify_personalisation,
28
+ email_reply_to_id: message.govuk_notify_email_reply_to
28
29
  }.compact
29
30
  end
30
31
 
@@ -4,5 +4,6 @@ module Mail
4
4
  attr_accessor :govuk_notify_reference
5
5
  attr_accessor :govuk_notify_personalisation
6
6
  attr_accessor :govuk_notify_response
7
+ attr_accessor :govuk_notify_email_reply_to
7
8
  end
8
9
  end
@@ -5,6 +5,7 @@ module GovukNotifyRails
5
5
  attr_accessor :govuk_notify_template
6
6
  attr_accessor :govuk_notify_reference
7
7
  attr_accessor :govuk_notify_personalisation
8
+ attr_accessor :govuk_notify_email_reply_to
8
9
 
9
10
  protected
10
11
 
@@ -17,6 +18,7 @@ module GovukNotifyRails
17
18
  message.govuk_notify_template = govuk_notify_template
18
19
  message.govuk_notify_reference = govuk_notify_reference
19
20
  message.govuk_notify_personalisation = govuk_notify_personalisation
21
+ message.govuk_notify_email_reply_to = govuk_notify_email_reply_to
20
22
  end
21
23
 
22
24
  def set_template(template)
@@ -31,6 +33,10 @@ module GovukNotifyRails
31
33
  self.govuk_notify_personalisation = personalisation
32
34
  end
33
35
 
36
+ def set_email_reply_to(address)
37
+ self.govuk_notify_email_reply_to = address
38
+ end
39
+
34
40
  def _default_body
35
41
  'This is a GOV.UK Notify email with template %s and personalisation: %s' % [govuk_notify_template, govuk_notify_personalisation]
36
42
  end
@@ -1,3 +1,3 @@
1
1
  module GovukNotifyRails
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.1.1'.freeze
3
3
  end
@@ -157,3 +157,15 @@ NotifyMailer#test_email: processed outbound mail in 0.4ms
157
157
  NotifyMailer#test_email: processed outbound mail in 0.4ms
158
158
  NotifyMailer#test_email: processed outbound mail in 0.4ms
159
159
  NotifyMailer#test_email: processed outbound mail in 0.3ms
160
+ NotifyMailer#test_email: processed outbound mail in 199.4ms
161
+ NotifyMailer#test_email: processed outbound mail in 0.7ms
162
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
163
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
164
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
165
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
166
+ NotifyMailer#test_email: processed outbound mail in 206.7ms
167
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
168
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
169
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
170
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
171
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
@@ -5,6 +5,7 @@ describe GovukNotifyRails::Delivery do
5
5
  describe '#deliver!' do
6
6
  let(:api_key) { 'api-key' }
7
7
  let(:notify_client) { double('NotifyClient') }
8
+ let(:reply_to) { "email_reply_to_reference" }
8
9
 
9
10
  let(:personalisation) { { name: 'John' } }
10
11
  let(:reference) { 'my_reference' }
@@ -15,7 +16,8 @@ describe GovukNotifyRails::Delivery do
15
16
  to: ['email@example.com'],
16
17
  govuk_notify_template: 'template-123',
17
18
  govuk_notify_reference: reference,
18
- govuk_notify_personalisation: personalisation
19
+ govuk_notify_personalisation: personalisation,
20
+ govuk_notify_email_reply_to: reply_to
19
21
  )
20
22
  end
21
23
 
@@ -29,7 +31,13 @@ describe GovukNotifyRails::Delivery do
29
31
 
30
32
  it 'should deliver the message payload' do
31
33
  expect(notify_client).to receive(:send_email).with(
32
- {email_address: 'email@example.com', template_id: 'template-123', reference: reference, personalisation: personalisation}
34
+ {
35
+ email_address: 'email@example.com',
36
+ template_id: 'template-123',
37
+ reference: reference,
38
+ personalisation: personalisation,
39
+ email_reply_to_id: reply_to
40
+ }
33
41
  )
34
42
  subject.deliver!(message)
35
43
  end
@@ -54,7 +62,12 @@ describe GovukNotifyRails::Delivery do
54
62
 
55
63
  it 'supports messages without personalisation' do
56
64
  expect(notify_client).to receive(:send_email).with(
57
- {email_address: 'email@example.com', template_id: 'template-123', reference: reference}
65
+ {
66
+ email_address: 'email@example.com',
67
+ template_id: 'template-123',
68
+ reference: reference,
69
+ email_reply_to_id: "email_reply_to_reference"
70
+ }
58
71
  )
59
72
  subject.deliver!(message)
60
73
  end
@@ -65,7 +78,28 @@ describe GovukNotifyRails::Delivery do
65
78
 
66
79
  it 'supports messages without a reference' do
67
80
  expect(notify_client).to receive(:send_email).with(
68
- {email_address: 'email@example.com', template_id: 'template-123', personalisation: personalisation}
81
+ {
82
+ email_address: 'email@example.com',
83
+ template_id: 'template-123',
84
+ personalisation: personalisation,
85
+ email_reply_to_id: "email_reply_to_reference"
86
+ }
87
+ )
88
+ subject.deliver!(message)
89
+ end
90
+ end
91
+
92
+ context 'no reply to address set' do
93
+ let(:reply_to) { nil }
94
+
95
+ it 'supports messages without reply to address' do
96
+ expect(notify_client).to receive(:send_email).with(
97
+ {
98
+ email_address: 'email@example.com',
99
+ template_id: 'template-123',
100
+ personalisation: personalisation,
101
+ reference: reference
102
+ }
69
103
  )
70
104
  subject.deliver!(message)
71
105
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_notify_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Laiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-22 00:00:00.000000000 Z
11
+ date: 2019-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails