brevo-rails 0.0.6.6 → 1.1.0

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
  SHA256:
3
- metadata.gz: b6eec0f43d7bcf767fbb831bbe111dc570ce9c95cfe86cc5fb1bcce0d6bfa27f
4
- data.tar.gz: 68b102cfa3d8b477ef1dec432becc2262774617866ca451387a8588e1f5ee62d
3
+ metadata.gz: 50bf8df6dd85488aa2e1d982cd4f58d2e9747d115b649e2c007fe8a556a97b33
4
+ data.tar.gz: 1775143e55c39cb9104e6373ef79b82a5b463eebf2956ad76f500570c1e4091f
5
5
  SHA512:
6
- metadata.gz: d90690b2af9c4aea60b77e851e2dec281e590b373a1eecd08305cf25a54c86432ee7902405d675785db2168d873f1eeccb5a7826209e328cab74f6fa547b9630
7
- data.tar.gz: 714e384a086e49419d47f8f3b0304cd9bd8c205baf40dbe350c8baa3bd91ef3671f49f67400ba002ddec4df4514322d61b833e973d0e569fed42b83d4aff8787
6
+ metadata.gz: 291362cde146bdf7c9006271fe7bfafe3559c54dd849e2b5a67125ae4021fd0d5c929fd653111eecd6979d355639a912519887feb645873c1ad5dfc68d9b220b
7
+ data.tar.gz: b8b8d26599162ab3276b8245e9e7bfd453d918a491b60251d783c022d16d7c781b41522fc630f2e4bb42f31e19fbbbb7d6c5d238929214c58ddff8187c50a1ba
data/README.md CHANGED
@@ -21,4 +21,17 @@ config.action_mailer.brevo_settings = {
21
21
  }
22
22
  ```
23
23
 
24
+ Send an email with tags
25
+
26
+ ```
27
+ def method
28
+ mail(
29
+ from: 'me@example.com',
30
+ to: 'you@example.com',
31
+ subject: 'Hello there!',
32
+ tags: ['tag1', 'tag2'],
33
+ )
34
+ end
35
+ ```
36
+
24
37
 
@@ -20,6 +20,7 @@ module BrevoRails
20
20
  params['cc'] = prepare_cc(address_list(message['cc'])&.addresses) if message['cc']
21
21
  params['bcc'] = prepare_bcc(address_list(message['bcc'])&.addresses) if message['bcc']
22
22
  params['attachment'] = prepare_attachments(message.attachments) if message.attachments.any?
23
+ params['tags'] = message['tags']&.unparsed_value if message['tags']
23
24
 
24
25
  Brevo::SendSmtpEmail.new(params)
25
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrevoRails
4
- VERSION = '0.0.6.6'
4
+ VERSION = '1.1.0'
5
5
  end
@@ -24,15 +24,6 @@ RSpec.describe BrevoRails::Mail do
24
24
  end
25
25
  end
26
26
 
27
- let(:message_with_attachments) do
28
- Mail.new do
29
- from 'Tester <test@example.com>'
30
- to 'you@example.com, her@example.com'
31
- subject 'This is a test email'
32
- headers 'X-Custom-Header' => 'Custom Value'
33
- attachments['test.png'] = File.read('spec/fixtures/test.png')
34
- end
35
- end
36
27
 
37
28
  before do
38
29
  message.text_part = text_part
@@ -73,11 +64,20 @@ RSpec.describe BrevoRails::Mail do
73
64
  expect(custom_header).to eq('Custom Value')
74
65
  end
75
66
 
76
- it 'sets attachments' do
67
+ it 'does not set attachments' do
77
68
  expect(subject.attachment).to be_nil
78
69
  end
79
70
 
80
71
  context 'with attachments' do
72
+ let(:message_with_attachments) do
73
+ Mail.new do
74
+ from 'Tester <test@example.com>'
75
+ to 'you@example.com, her@example.com'
76
+ subject 'This is a test email'
77
+ attachments['test.png'] = File.read('spec/fixtures/test.png')
78
+ end
79
+ end
80
+
81
81
  subject { BrevoRails::Mail.from_message(message_with_attachments) }
82
82
 
83
83
  it 'sets attachments' do
@@ -87,5 +87,20 @@ RSpec.describe BrevoRails::Mail do
87
87
  end
88
88
  end
89
89
 
90
+ context 'with tags' do
91
+ let(:message_with_tags) do
92
+ Mail.new(from: 'Tester <test@example.com>',
93
+ to: 'you@example.com, her@example.com',
94
+ subject: 'This is a test email',
95
+ tags: ['tag1', 'tag2'])
96
+ end
97
+
98
+ subject { BrevoRails::Mail.from_message(message_with_tags) }
99
+
100
+ it 'sets tags' do
101
+ expect(subject.tags).to eq(['tag1', 'tag2'])
102
+ end
103
+ end
90
104
  end
105
+
91
106
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brevo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6.6
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franck D'agostini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-07 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug