mailslurp_client 11.5.20 → 11.5.21
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 +22 -1
- 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: 9c445b6978528974d13db988f59d1200c686b19e8fd7f3e28f61f33bb129db49
|
4
|
+
data.tar.gz: d96c63f0de8fe586dd38af8ba8ba5eec6f9fe1085449e2ee59370a9749e0dee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebc76d5fdd24caabb6bae147ed8339645a897fb6ffdd667167aa89112fa9478615ce4a2a784663f554fe98fb0633915298c96a1a8c375b59ee88a18d65cac23b
|
7
|
+
data.tar.gz: 10435801619dc0122b3b681c2331fcceed88bf57b0ea43e11b439fc651bce7fd400f2a589b441ac62ee1259ce9e9bcfa4713302cd596bc7eedede239e7785513
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ First you'll need an API Key. [Create a free account](https://app.mailslurp.com)
|
|
24
24
|
|
25
25
|
### Ruby requirements
|
26
26
|
|
27
|
-
The MailSlurp client requires Ruby 2.x and the ruby-dev package. You most likely have these packages but if not:
|
27
|
+
The MailSlurp client requires Ruby 2.x or 3.x and the ruby-dev package. You most likely have these packages but if not:
|
28
28
|
|
29
29
|
`sudo apt-get install ruby-dev`
|
30
30
|
|
@@ -47,6 +47,9 @@ gem install bundler
|
|
47
47
|
bundle install
|
48
48
|
```
|
49
49
|
|
50
|
+
#### Libcurl requirements
|
51
|
+
You may need to install `typhoeus` if you encounter libcurl errors.
|
52
|
+
|
50
53
|
|
51
54
|
### Configure the client
|
52
55
|
|
@@ -191,6 +194,24 @@ expect(email.subject).to include("Test")
|
|
191
194
|
expect(email.body).to include("Your email body")
|
192
195
|
```
|
193
196
|
|
197
|
+
### Extract email content
|
198
|
+
To parse an email and extract content use regex patterns like so:
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
wait_controller = MailSlurpClient::WaitForControllerApi.new
|
202
|
+
email = wait_controller.wait_for_latest_email({ inbox_id: inbox.id, unread_only: true, timeout: 30_000 })
|
203
|
+
|
204
|
+
# assert the email is a confirmation
|
205
|
+
expect(email.subject).to include("Please confirm your email address")
|
206
|
+
|
207
|
+
# extract a 6 digit code from the email body
|
208
|
+
match = email.body.match(/code is ([0-9]{6})/)
|
209
|
+
if match == nil then
|
210
|
+
raise "Could not find match in body #{email.body}"
|
211
|
+
end
|
212
|
+
code, * = match.captures
|
213
|
+
```
|
214
|
+
|
194
215
|
### Attachments
|
195
216
|
|
196
217
|
You can send attachments by first uploading files with the `AttachmentControllerApi` then using the returned attachment IDs in the send email method.
|
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: 11.5.
|
4
|
+
version: 11.5.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mailslurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-06 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/docs/ruby/ for full Ruby documentation.
|