gettestmail 1.0.0 → 1.0.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/README.md +94 -1
- metadata +2 -2
- /data/lib/{client.rb → gettestmailclient.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 694141f1056032b4e20b962abc3e4828e7cae8e9f863015a1f825edf643eb460
|
4
|
+
data.tar.gz: b32e03e36edad77422f9209a389f4cb38002f2a51b3cffbc834382789a3bde11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06f520cbb20a02f459fc7eb9ccdefa27c75182b2488e41cbc68be2cf15573831a5013195f1f583b657ca91310034ba10d8bc64aa657309cd769fb4bd92fba1ca
|
7
|
+
data.tar.gz: cc5ceb0bfee07c9fd4ebd3fa53aaa70f0fc67f9ba1a5115f33a3200b98216ad020a4003abfc9c97c3ef382be69867483638b42ae6e9665d671d6926e5085da38
|
data/README.md
CHANGED
@@ -1,2 +1,95 @@
|
|
1
1
|
# ruby-sdk
|
2
|
-
|
2
|
+
|
3
|
+
A Ruby client for interacting with the GetTestMail API, which allows you to create disposable email addresses for testing purposes.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'gettestmail'
|
10
|
+
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
```
|
15
|
+
$ bundle install
|
16
|
+
```
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
```
|
21
|
+
$ gem install gettestmail
|
22
|
+
```
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
Creating a New Client
|
27
|
+
To create a new GetTestMail API client, you need to instantiate the GetTestMailClient class with your API key:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'gettestmailclient'
|
31
|
+
|
32
|
+
api_key = 'your-api-key'
|
33
|
+
client = GetTestMailClient.new(api_key)
|
34
|
+
```
|
35
|
+
|
36
|
+
Creating a New GetTestMail Instance
|
37
|
+
To create a new GetTestMail instance, call the create_new method on the client:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
get_test_mail = client.create_new
|
41
|
+
puts "Email address: #{get_test_mail.email_address}"
|
42
|
+
puts "Expires at: #{get_test_mail.expires_at}"
|
43
|
+
# Waiting for a Message
|
44
|
+
# To wait for a message, call the wait_for_message method with the email address:
|
45
|
+
|
46
|
+
message = client.wait_for_message(get_test_mail.email_address)
|
47
|
+
puts "Message from: #{message.from}"
|
48
|
+
puts "Message subject: #{message.subject}"
|
49
|
+
puts "Message: #{message}"
|
50
|
+
```
|
51
|
+
|
52
|
+
## Models
|
53
|
+
|
54
|
+
### GetTestMail
|
55
|
+
|
56
|
+
The GetTestMail model represents a disposable email address. It has the following attributes:
|
57
|
+
|
58
|
+
```
|
59
|
+
email_address: The disposable email address.
|
60
|
+
expires_at: The expiration time of the email address.
|
61
|
+
```
|
62
|
+
|
63
|
+
### Message
|
64
|
+
|
65
|
+
The Message model represents an email message. It has the following attributes:
|
66
|
+
|
67
|
+
```
|
68
|
+
id: The unique identifier of the message.
|
69
|
+
from: The sender's email address.
|
70
|
+
to: The recipient's email address.
|
71
|
+
subject: The subject of the email.
|
72
|
+
text: The plain text version of the email.
|
73
|
+
html: The HTML version of the email.
|
74
|
+
attachments: An array of Attachment objects.
|
75
|
+
```
|
76
|
+
|
77
|
+
### Attachment
|
78
|
+
|
79
|
+
The Attachment model represents an email attachment. It has the following attributes:
|
80
|
+
|
81
|
+
```
|
82
|
+
filename: The name of the attached file.
|
83
|
+
mime_type: The MIME type of the attached file.
|
84
|
+
content: The content of the attached file.
|
85
|
+
```
|
86
|
+
|
87
|
+
## Error Handling
|
88
|
+
|
89
|
+
|
90
|
+
If the API returns an error, the client will raise an ApiError exception with a ProblemDTO object containing error details.
|
91
|
+
|
92
|
+
|
93
|
+
License
|
94
|
+
|
95
|
+
This gem is available as open-source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gettestmail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bobby Donchev
|
@@ -36,7 +36,7 @@ files:
|
|
36
36
|
- LICENSE
|
37
37
|
- README.md
|
38
38
|
- lib/api_error.rb
|
39
|
-
- lib/
|
39
|
+
- lib/gettestmailclient.rb
|
40
40
|
- lib/models/attachment.rb
|
41
41
|
- lib/models/base_dto.rb
|
42
42
|
- lib/models/get_test_mail.rb
|
File without changes
|