mailtrap 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
  SHA256:
3
- metadata.gz: 5423fd6ba2817ace06e724da478e925615f3c8b4dfcbf24eb271f6bb12fded4c
4
- data.tar.gz: b331be242b93d7176adf0ca92d01f33d0bc7a9407766d8d139d8bb39d7d2382b
3
+ metadata.gz: 30f80c3c771f5d73e22d3731d3f8d619793be03b378f48251e0e17e0e33d5d60
4
+ data.tar.gz: 41523de1f211b8ef4900efe6abd2343afb67803921fe495372c1d780d5b0f6fa
5
5
  SHA512:
6
- metadata.gz: 9c2556e7ea3b7405ec76910a718ba949694563dabc4547fc6b33771bd52a2bd0e444e287bcc341c6c5e1bdab07bd12573c3ce9607cbcc84afbd8398aafbccf4c
7
- data.tar.gz: 06f0ea3e473461ad889e101540ba2d2a37cfda75ce3a4677ab58708ddae8ce4cae53d16426f4b30e54bf899e9a5f3cca0c46e0616c49b9da80be9c1e8c308c67
6
+ metadata.gz: 781f8682fec57e56274d6de148bf24cc2d21ae8582e31a00585eaceb15481cf8b8508f9f1ba7f32b54e71c3c18b5062a6f2be407f5e14df0b78b5038a1086e9e
7
+ data.tar.gz: 1f22fc8e1c76efb7e0050d68b731ea0ceba6a65a8d37cea1da72369d41287f657492e005683648b1b7279e15e059f6c14a4ec724015763f2d212bde1407dd097
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [2.1.1] - 2024-12-11
2
+
3
+ - Improved handling of empty `from`
4
+
1
5
  ## [2.1.0] - 2024-07-08
2
6
 
3
7
  - Fixed extraneous headers added by ActionMailer #21
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mailtrap (2.1.0)
4
+ mailtrap (2.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -46,8 +46,7 @@ GEM
46
46
  rainbow (3.1.1)
47
47
  rake (13.2.1)
48
48
  regexp_parser (2.9.2)
49
- rexml (3.3.1)
50
- strscan
49
+ rexml (3.3.9)
51
50
  rspec (3.13.0)
52
51
  rspec-core (~> 3.13.0)
53
52
  rspec-expectations (~> 3.13.0)
@@ -82,7 +81,6 @@ GEM
82
81
  rubocop-rspec (3.0.2)
83
82
  rubocop (~> 1.61)
84
83
  ruby-progressbar (1.13.0)
85
- strscan (3.1.0)
86
84
  thor (1.3.1)
87
85
  timeout (0.4.1)
88
86
  unicode-display_width (2.5.0)
data/README.md CHANGED
@@ -1,4 +1,9 @@
1
1
  [![test](https://github.com/railsware/mailtrap-ruby/actions/workflows/main.yml/badge.svg)](https://github.com/railsware/mailtrap-ruby/actions/workflows/main.yml)
2
+ [![docs](https://shields.io/badge/docs-rubydoc.info-blue)](https://rubydoc.info/gems/mailtrap)
3
+ [![gem](https://shields.io/gem/v/mailtrap)](https://rubygems.org/gems/mailtrap)
4
+ [![downloads](https://shields.io/gem/dt/mailtrap)](https://rubygems.org/gems/mailtrap)
5
+
6
+
2
7
 
3
8
  # Official Mailtrap Ruby client
4
9
 
@@ -26,7 +31,17 @@ Or install it yourself as:
26
31
 
27
32
  ## Usage
28
33
 
29
- ### Minimal
34
+ ### Ruby on Rails
35
+
36
+ ```ruby
37
+ # place this code in config/environments/production.rb:
38
+ config.action_mailer.delivery_method = :mailtrap
39
+
40
+ # then set the MAILTRAP_API_KEY environment variable
41
+ # using your hosting solution.
42
+ ```
43
+
44
+ ### Pure Ruby
30
45
 
31
46
  ```ruby
32
47
  require 'mailtrap'
@@ -46,7 +61,7 @@ client = Mailtrap::Client.new(api_key: 'your-api-key')
46
61
  client.send(mail)
47
62
  ```
48
63
 
49
- Refer to the [`examples`](examples) folder for other examples.
64
+ Refer to the [`examples`](examples) folder for more examples.
50
65
 
51
66
  - [Full](examples/full.rb)
52
67
  - [Email template](examples/email_template.rb)
@@ -55,15 +70,15 @@ Refer to the [`examples`](examples) folder for other examples.
55
70
  ### Content-Transfer-Encoding
56
71
 
57
72
  `mailtrap` gem uses Mailtrap API to send emails. Mailtrap API does not try to
58
- replicate SMTP. That is why you should expect some limitations when it comes to
73
+ replicate SMTP. That is why you should expect some limitations when it comes to
59
74
  sending. For example, `/api/send` endpoint ignores `Content-Transfer-Encoding`
60
75
  (see `headers` in the [API documentation](https://railsware.stoplight.io/docs/mailtrap-api-docs/67f1d70aeb62c-send-email)).
61
- Meaning your recipients will receive emails only in the default encoding which
76
+ Meaning your recipients will receive emails only in the default encoding which
62
77
  is `quoted-printable`, if you send with Mailtrap API.
63
78
 
64
- For those who does need to use `7bit` or any other encoding, SMTP provides
65
- better flexibility in that regard. Go to your _Mailtrap account_ → _Email Sending_
66
- → _Sending Domains_ → _Your domain_ → _SMTP/API Settings_ to find the SMTP
79
+ For those who does need to use `7bit` or any other encoding, SMTP provides
80
+ better flexibility in that regard. Go to your _Mailtrap account_ → _Email Sending_
81
+ → _Sending Domains_ → _Your domain_ → _SMTP/API Settings_ to find the SMTP
67
82
  configuration example.
68
83
 
69
84
  ## Migration guide v1 → v2
data/lib/mailtrap/mail.rb CHANGED
@@ -8,9 +8,9 @@ require_relative 'mail/from_template'
8
8
  module Mailtrap
9
9
  module Mail
10
10
  class << self
11
- def from_message(message) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity
11
+ def from_message(message) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
12
12
  Mailtrap::Mail::Base.new(
13
- from: prepare_address(address_list(message['from'])&.addresses&.first),
13
+ from: prepare_addresses(address_list(message['from'])&.addresses).first,
14
14
  to: prepare_addresses(address_list(message['to'])&.addresses),
15
15
  cc: prepare_addresses(address_list(message['cc'])&.addresses),
16
16
  bcc: prepare_addresses(address_list(message['bcc'])&.addresses),
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailtrap
4
- VERSION = '2.1.0'
4
+ VERSION = '2.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailtrap
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
  - Railsware Products Studio LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-12-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Official mailtrap.io API client
14
14
  email:
@@ -19,7 +19,6 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - ".rspec"
21
21
  - ".rubocop.yml"
22
- - ".ruby-version"
23
22
  - Appraisals
24
23
  - CHANGELOG.md
25
24
  - CODE_OF_CONDUCT.md
@@ -63,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
62
  - !ruby/object:Gem::Version
64
63
  version: '0'
65
64
  requirements: []
66
- rubygems_version: 3.5.11
65
+ rubygems_version: 3.4.10
67
66
  signing_key:
68
67
  specification_version: 4
69
68
  summary: Official mailtrap.io API client
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.3.3