mailslurp_client 15.17.40 → 15.17.41
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/README.md +23 -22
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1877e1d62462c84900b2f639ad0fdbfd7ec15e07595bbac9e4a15f7a9767d0b2
|
4
|
+
data.tar.gz: df302298ff1be36183a7dee03b5349758460b332c98e66b9cc35f386249bebc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a160571de0f62f45e66209e4532644bba01cf4935b9a2a36b78d7f5e98f157788bd9f86d51ba3fe741a8bda042ebc927eebd3b120de90796b871f04fde7d3f75
|
7
|
+
data.tar.gz: e1183548bff3750e0e28c8d610c427ca4f4269a452f9bffd1655964b99c9a389ed33dd53ad51a3eb63e495c55a05700e02db2a896696d35316f500552a507ff2
|
data/README.md
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
MailSlurp is an email API service that lets you create real email addresses in code. You can then send and receive emails and attachments in Ruby applications and tests.
|
6
6
|
|
7
|
+
[](https://youtu.be/NEIIrU1E3H8)
|
8
|
+
|
7
9
|
## Quick links
|
8
10
|
|
9
11
|
- [API documentation](https://docs.mailslurp.com/api/)
|
@@ -48,9 +50,7 @@ gem install mailslurp_client
|
|
48
50
|
|
49
51
|
Or in your `Gemfile`:
|
50
52
|
|
51
|
-
|
52
|
-
gem 'mailslurp_client', '~> 8.3', '>= 8.3.0'
|
53
|
-
```
|
53
|
+
{{<gen_ruby_ruby_minitest_gemspec>}}
|
54
54
|
|
55
55
|
And then run bundler install:
|
56
56
|
|
@@ -63,17 +63,19 @@ bundle install
|
|
63
63
|
|
64
64
|
You may need to install `typhoeus` if you encounter libcurl errors.
|
65
65
|
|
66
|
+
```
|
67
|
+
gem 'typhoeus'
|
68
|
+
```
|
69
|
+
|
66
70
|
|
67
71
|
### Configure the client
|
68
72
|
|
69
|
-
|
70
|
-
require 'mailslurp_client'
|
73
|
+
{{<gen_ruby_ruby_minitest_configure>}}
|
71
74
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
```
|
75
|
+
### Create controllers
|
76
|
+
To call the API create a controller like this:
|
77
|
+
|
78
|
+
{{<gen_ruby_ruby_minitest_create_controller>}}
|
77
79
|
|
78
80
|
## Common uses
|
79
81
|
|
@@ -85,10 +87,7 @@ Here are some common uses:
|
|
85
87
|
|
86
88
|
To use MailSlurp you need to create inboxes. These are email accounts that have an ID and a real email address. See methods on the [inbox controller](https://ruby.mailslurp.com/MailSlurpClient/InboxControllerApi.html) for more information.
|
87
89
|
|
88
|
-
|
89
|
-
inbox_controller = MailSlurpClient::InboxControllerApi.new
|
90
|
-
inbox = inbox_controller.create_inbox
|
91
|
-
```
|
90
|
+
{{<gen_ruby_ruby_minitest_create_inbox>}}
|
92
91
|
|
93
92
|
In a test:
|
94
93
|
|
@@ -199,6 +198,9 @@ end
|
|
199
198
|
### Send emails
|
200
199
|
|
201
200
|
You can send HTML emails easily with the inbox controller. First create an inbox then use its ID with the `send_email` method.
|
201
|
+
|
202
|
+
{{<gen_ruby_ruby_minitest_send_email>}}
|
203
|
+
|
202
204
|
To send attachments see the [Method Documentation](https://ruby.mailslurp.com/).
|
203
205
|
|
204
206
|
```ruby
|
@@ -238,23 +240,22 @@ opts = {
|
|
238
240
|
inbox_controller.send_email(inbox_1.id, opts)
|
239
241
|
```
|
240
242
|
|
243
|
+
### Send with SMTP
|
244
|
+
|
245
|
+
{{<gen_ruby_ruby_minitest_smtp_send>}}
|
246
|
+
|
241
247
|
### Receive emails
|
242
248
|
|
243
249
|
To read already existing emails use the [Email Controller](https://ruby.mailslurp.com/MailSlurpClient/EmailControllerApi.html). To wait for expected emails to arrive use the [WaitFor Controller](https://ruby.mailslurp.com/MailSlurpClient/WaitForControllerApi.html).
|
244
250
|
You can use MailSlurp to wait for at least 1 unread email in an inbox and return it.
|
245
251
|
If a timeout is exceeded it will throw an error instead:
|
246
252
|
|
247
|
-
|
248
|
-
waitfor_controller = MailSlurpClient::WaitForControllerApi.new
|
249
|
-
email = waitfor_controller.wait_for_latest_email({ inbox_id: inbox.id, unread_only: true, timeout: 30_000 })
|
250
|
-
|
251
|
-
# verify email contents
|
252
|
-
expect(email.subject).to include("Test")
|
253
|
-
expect(email.body).to include("Your email body")
|
254
|
-
```
|
253
|
+
{{<gen_ruby_ruby_minitest_receive_email>}}
|
255
254
|
|
256
255
|
### Extract email content
|
257
256
|
|
257
|
+
{{<gen_ruby_ruby_minitest_extract_code>}}
|
258
|
+
|
258
259
|
To parse an email and extract content use regex patterns like so:
|
259
260
|
|
260
261
|
```ruby
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailslurp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.17.
|
4
|
+
version: 15.17.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mailslurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Create emails addresses in Ruby then send and receive real emails and
|
14
14
|
attachments. See https://www.mailslurp.com/ruby/ for full Ruby documentation. Get
|