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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -4
- data/README.md +22 -7
- data/lib/mailtrap/mail.rb +2 -2
- data/lib/mailtrap/version.rb +1 -1
- metadata +3 -4
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30f80c3c771f5d73e22d3731d3f8d619793be03b378f48251e0e17e0e33d5d60
|
4
|
+
data.tar.gz: 41523de1f211b8ef4900efe6abd2343afb67803921fe495372c1d780d5b0f6fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 781f8682fec57e56274d6de148bf24cc2d21ae8582e31a00585eaceb15481cf8b8508f9f1ba7f32b54e71c3c18b5062a6f2be407f5e14df0b78b5038a1086e9e
|
7
|
+
data.tar.gz: 1f22fc8e1c76efb7e0050d68b731ea0ceba6a65a8d37cea1da72369d41287f657492e005683648b1b7279e15e059f6c14a4ec724015763f2d212bde1407dd097
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mailtrap (2.1.
|
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.
|
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
|
[](https://github.com/railsware/mailtrap-ruby/actions/workflows/main.yml)
|
2
|
+
[](https://rubydoc.info/gems/mailtrap)
|
3
|
+
[](https://rubygems.org/gems/mailtrap)
|
4
|
+
[](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
|
-
###
|
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
|
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
|
11
|
+
def from_message(message) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
12
12
|
Mailtrap::Mail::Base.new(
|
13
|
-
from:
|
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),
|
data/lib/mailtrap/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|