mailslurp_client 8.2.2 → 8.2.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c939cc4a13acdfa00befd57219f03fb5043cfcd59388d515edb4fb998a5b6d79
|
4
|
+
data.tar.gz: 0e2a9812fe11d95e8cf0fff0a529ab013a502ed09fb801088efb5cebeddea021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ec7920d5f89318fb2dc9dd36ee6c1f862e56d78fb7ec3b5d1db19f528f04fa7b494b0d20e1eee66953ccc115e569b4844ac020df7f2634e479bde828753b0ee
|
7
|
+
data.tar.gz: 6a10885e285042aaf67a7ce890b512bea25205b358a2e0e3b84a2361e38e021ff81c3e04649ed246a7fc43e55eb9c18684c0682caf57e1038b9ea5f3167be6f0
|
data/README.md
CHANGED
@@ -13,11 +13,13 @@ MailSlurp is an email API service that lets you create real email addresses in c
|
|
13
13
|
## Get started
|
14
14
|
|
15
15
|
::: tip
|
16
|
+
|
16
17
|
This section describes how to get up and running with the Ruby client.
|
17
18
|
|
18
19
|
See the [examples page](https://www.mailslurp.com/examples/) for more examples and use with common frameworks such as Rails and RSpec.
|
19
20
|
|
20
21
|
See the method documentation for a [list of all functions](./docs)
|
22
|
+
|
21
23
|
:::
|
22
24
|
|
23
25
|
### Create API Key
|
@@ -39,15 +41,23 @@ gem install mailslurp_client
|
|
39
41
|
Or in your `Gemfile`:
|
40
42
|
|
41
43
|
```ruby
|
42
|
-
gem 'mailslurp_client', '~>
|
44
|
+
gem 'mailslurp_client', '~> 8.2', '>= 8.2.2'
|
45
|
+
```
|
46
|
+
|
47
|
+
And then run bundler install:
|
48
|
+
|
49
|
+
```bash
|
50
|
+
gem install bundler
|
51
|
+
bundle install
|
43
52
|
```
|
44
53
|
|
54
|
+
|
45
55
|
### Configure the client
|
46
56
|
|
47
57
|
```ruby
|
48
58
|
require 'mailslurp_client'
|
49
59
|
|
50
|
-
# configure
|
60
|
+
# configure mailslurp client globally with API key (or pass each controller a client instance)
|
51
61
|
MailSlurpClient.configure do |config|
|
52
62
|
config.api_key['x-api-key'] = "YOUR_API_KEY_HERE"
|
53
63
|
end
|
@@ -80,6 +90,26 @@ it 'can create email addresses' do
|
|
80
90
|
end
|
81
91
|
```
|
82
92
|
|
93
|
+
### List inboxes
|
94
|
+
|
95
|
+
Inboxes you create can be listed in a paginated way.
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
it 'can list inboxes' do
|
99
|
+
inbox_controller = MailSlurpClient::InboxControllerApi.new
|
100
|
+
paged_inboxes = inbox_controller.get_all_inboxes({ page: 0, size: 20 })
|
101
|
+
|
102
|
+
# assert on pagination fields
|
103
|
+
expect(paged_inboxes.content).not_to be_empty
|
104
|
+
expect(paged_inboxes.number).to be(0)
|
105
|
+
expect(paged_inboxes.size).to be(20)
|
106
|
+
|
107
|
+
# can access inbox result
|
108
|
+
expect(paged_inboxes.content[0].id).not_to be_empty
|
109
|
+
end
|
110
|
+
```
|
111
|
+
|
112
|
+
|
83
113
|
### Send emails
|
84
114
|
|
85
115
|
You can send HTML emails easily with the inbox controller. First create an inbox then use its ID with the `send_email` method.
|
@@ -104,6 +134,24 @@ inbox_controller.send_email(inbox.id, {
|
|
104
134
|
})
|
105
135
|
```
|
106
136
|
|
137
|
+
You can also use objects for most method options:
|
138
|
+
|
139
|
+
```ruby
|
140
|
+
# for send options see https://github.com/mailslurp/mailslurp-client-ruby/blob/master/docs/SendEmailOptions.md
|
141
|
+
opts = {
|
142
|
+
send_email_options: MailSlurpClient::SendEmailOptions.new(
|
143
|
+
{
|
144
|
+
to: [inbox_2.email_address],
|
145
|
+
subject: 'Test email',
|
146
|
+
from: inbox_1.email_address,
|
147
|
+
body: 'Test email content',
|
148
|
+
is_html: true,
|
149
|
+
attachments: attachment_ids
|
150
|
+
}
|
151
|
+
)
|
152
|
+
}
|
153
|
+
inbox_controller.send_email(inbox_1.id, opts)
|
154
|
+
```
|
107
155
|
### Receive emails
|
108
156
|
|
109
157
|
You can use MailSlurp to wait for at least 1 unread email in an inbox and return it.
|
@@ -111,13 +159,161 @@ If a timeout is exceeded it will throw an error instead:
|
|
111
159
|
|
112
160
|
```ruby
|
113
161
|
waitfor_controller = MailSlurpClient::WaitForControllerApi.new
|
114
|
-
email = waitfor_controller.wait_for_latest_email({ inbox_id: inbox.id, unread_only: true })
|
162
|
+
email = waitfor_controller.wait_for_latest_email({ inbox_id: inbox.id, unread_only: true, timeout: 30_000 })
|
115
163
|
|
116
164
|
# verify email contents
|
117
165
|
expect(email.subject).to include("Test")
|
118
166
|
expect(email.body).to include("Your email body")
|
119
167
|
```
|
120
168
|
|
169
|
+
### Attachments
|
170
|
+
|
171
|
+
You can send attachments by first uploading files with the `AttachmentControllerApi` then using the returned attachment IDs in the send email method.
|
172
|
+
|
173
|
+
::: tip
|
174
|
+
|
175
|
+
MailSlurp endpoints use base64 string encoding for upload and download files. To encode or decode strings in Ruby make sure you use the **strict** variables that avoid added newlines.
|
176
|
+
|
177
|
+
:::
|
178
|
+
|
179
|
+
#### Upload and send
|
180
|
+
```ruby
|
181
|
+
# upload a file to mailslurp to use as attachment
|
182
|
+
# @return [Array<String>]
|
183
|
+
def upload_file
|
184
|
+
# read a file to upload
|
185
|
+
data = File.open(PATH_TO_ATTACHMENT).read
|
186
|
+
|
187
|
+
# encode the data as base64 string (must be strict to avoid ruby adding new line characters)
|
188
|
+
encoded = Base64.strict_encode64(data)
|
189
|
+
|
190
|
+
attachment_controller = MailSlurpClient::AttachmentControllerApi.new
|
191
|
+
upload_options = MailSlurpClient::UploadAttachmentOptions.new(
|
192
|
+
{
|
193
|
+
base64_contents: encoded,
|
194
|
+
content_type: 'text/plain',
|
195
|
+
filename: 'attachment.txt'
|
196
|
+
}
|
197
|
+
)
|
198
|
+
|
199
|
+
# return list of attachment ids
|
200
|
+
attachment_controller.upload_attachment(upload_options)
|
201
|
+
end
|
202
|
+
```
|
203
|
+
|
204
|
+
To send attachments
|
205
|
+
|
206
|
+
```ruby
|
207
|
+
attachment_ids = upload_file
|
208
|
+
|
209
|
+
opts = {
|
210
|
+
send_email_options: MailSlurpClient::SendEmailOptions.new(
|
211
|
+
{
|
212
|
+
to: [inbox_2.email_address],
|
213
|
+
subject: 'Test email',
|
214
|
+
from: inbox_1.email_address,
|
215
|
+
body: 'Test email content',
|
216
|
+
is_html: true,
|
217
|
+
attachments: attachment_ids
|
218
|
+
}
|
219
|
+
)
|
220
|
+
}
|
221
|
+
inbox_controller.send_email(inbox_1.id, opts)
|
222
|
+
```
|
223
|
+
|
224
|
+
#### Download received attachments
|
225
|
+
```ruby
|
226
|
+
# wait for the email to arrive (or fetch directly using email controller if you know it is there)
|
227
|
+
wait_opts = {
|
228
|
+
inbox_id: inbox_2.id,
|
229
|
+
timeout: 30_000,
|
230
|
+
unread_only: true
|
231
|
+
}
|
232
|
+
email = wait_controller.wait_for_latest_email(wait_opts)
|
233
|
+
|
234
|
+
# find the attachments on the email object
|
235
|
+
expect(email.attachments.size).to be(1)
|
236
|
+
|
237
|
+
# download the attachment
|
238
|
+
email_controller = MailSlurpClient::EmailControllerApi.new
|
239
|
+
downloaded_attachment = email_controller.download_attachment_base64(email.attachments[0], email.id)
|
240
|
+
|
241
|
+
# extract attachment content
|
242
|
+
expect(downloaded_attachment.content_type).to eq("text/plain")
|
243
|
+
expect(downloaded_attachment.size_bytes).to be_truthy
|
244
|
+
expect(downloaded_attachment.base64_file_contents).to be_truthy
|
245
|
+
```
|
246
|
+
|
247
|
+
## Examples
|
248
|
+
|
249
|
+
### Send email between two inboxes
|
250
|
+
|
251
|
+
It is common to use MailSlurp in test environments. Here is an example RSpec test:
|
252
|
+
|
253
|
+
```ruby
|
254
|
+
|
255
|
+
require 'mailslurp_client'
|
256
|
+
|
257
|
+
# read mailslurp api key from environment variables
|
258
|
+
API_KEY = ENV['API_KEY']
|
259
|
+
|
260
|
+
describe 'use MailSlurp ruby sdk to create email addresses then send and receive email' do
|
261
|
+
before(:all) do
|
262
|
+
expect(API_KEY).to be_truthy
|
263
|
+
|
264
|
+
# configure mailslurp with API key
|
265
|
+
MailSlurpClient.configure do |config|
|
266
|
+
config.api_key['x-api-key'] = API_KEY
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
it 'can an inbox with an email address' do
|
271
|
+
# create a new email address
|
272
|
+
inbox_controller = MailSlurpClient::InboxControllerApi.new
|
273
|
+
inbox = inbox_controller.create_inbox
|
274
|
+
|
275
|
+
# has a mailslurp email address
|
276
|
+
expect(inbox.id).to be_truthy
|
277
|
+
expect(inbox.email_address).to include('@mailslurp.com')
|
278
|
+
end
|
279
|
+
|
280
|
+
it 'can send and receive emails' do
|
281
|
+
inbox_controller = MailSlurpClient::InboxControllerApi.new
|
282
|
+
wait_controller = MailSlurpClient::WaitForControllerApi.new
|
283
|
+
|
284
|
+
# create two inboxes
|
285
|
+
inbox_1 = inbox_controller.create_inbox
|
286
|
+
inbox_2 = inbox_controller.create_inbox
|
287
|
+
|
288
|
+
# send email from inbox 1 to inbox 2 (you can send emails to any address)
|
289
|
+
# for send options see https://github.com/mailslurp/mailslurp-client-ruby/blob/master/docs/SendEmailOptions.md
|
290
|
+
opts = {
|
291
|
+
send_email_options: MailSlurpClient::SendEmailOptions.new(
|
292
|
+
{
|
293
|
+
to: [inbox_2.email_address],
|
294
|
+
subject: 'Test email',
|
295
|
+
from: inbox_1.email_address,
|
296
|
+
body: 'Test email content',
|
297
|
+
is_html: true
|
298
|
+
}
|
299
|
+
)
|
300
|
+
}
|
301
|
+
inbox_controller.send_email(inbox_1.id, opts)
|
302
|
+
|
303
|
+
expect(inbox_2.id).to be_truthy
|
304
|
+
|
305
|
+
# now wait for the email to arrive
|
306
|
+
wait_opts = {
|
307
|
+
inbox_id: inbox_2.id,
|
308
|
+
timeout: 30_000,
|
309
|
+
unread_only: true
|
310
|
+
}
|
311
|
+
email = wait_controller.wait_for_latest_email(wait_opts)
|
312
|
+
expect(email.body).to include('Test email content')
|
313
|
+
end
|
314
|
+
end
|
315
|
+
```
|
316
|
+
|
121
317
|
## SDK Documentation
|
122
318
|
|
123
319
|
See the [examples page](https://www.mailslurp.com/examples/) or the full [Method Documentation](./docs) on Github.
|
@@ -19,8 +19,8 @@ module MailSlurpClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
# Upload an attachment for sending
|
23
|
-
# When sending emails with attachments first upload each attachment with
|
22
|
+
# Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
|
23
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
24
24
|
# @param upload_options [UploadAttachmentOptions] uploadOptions
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @return [Array<String>]
|
@@ -29,8 +29,8 @@ module MailSlurpClient
|
|
29
29
|
data
|
30
30
|
end
|
31
31
|
|
32
|
-
# Upload an attachment for sending
|
33
|
-
# When sending emails with attachments first upload each attachment with
|
32
|
+
# Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
|
33
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
34
34
|
# @param upload_options [UploadAttachmentOptions] uploadOptions
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
36
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
@@ -83,26 +83,92 @@ module MailSlurpClient
|
|
83
83
|
return data, status_code, headers
|
84
84
|
end
|
85
85
|
|
86
|
-
# Upload an attachment for sending using
|
87
|
-
# When sending emails with attachments first upload each attachment with
|
86
|
+
# Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
|
87
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
88
|
+
# @param [Hash] opts the optional parameters
|
89
|
+
# @option opts [String] :string Optional contentType for file. For instance `application/pdf`
|
90
|
+
# @option opts [String] :filename Optional filename to save upload with
|
91
|
+
# @option opts [String] :byte_array Byte array request body
|
92
|
+
# @return [Array<String>]
|
93
|
+
def upload_attachment_bytes(opts = {})
|
94
|
+
data, _status_code, _headers = upload_attachment_bytes_with_http_info(opts)
|
95
|
+
data
|
96
|
+
end
|
97
|
+
|
98
|
+
# Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
|
99
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @option opts [String] :string Optional contentType for file. For instance `application/pdf`
|
102
|
+
# @option opts [String] :filename Optional filename to save upload with
|
103
|
+
# @option opts [String] :byte_array Byte array request body
|
104
|
+
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
105
|
+
def upload_attachment_bytes_with_http_info(opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug 'Calling API: AttachmentControllerApi.upload_attachment_bytes ...'
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '/attachments/bytes'
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = opts[:query_params] || {}
|
114
|
+
query_params[:'String'] = opts[:'string'] if !opts[:'string'].nil?
|
115
|
+
query_params[:'filename'] = opts[:'filename'] if !opts[:'filename'].nil?
|
116
|
+
|
117
|
+
# header parameters
|
118
|
+
header_params = opts[:header_params] || {}
|
119
|
+
# HTTP header 'Accept' (if needed)
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
121
|
+
# HTTP header 'Content-Type'
|
122
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
|
123
|
+
|
124
|
+
# form parameters
|
125
|
+
form_params = opts[:form_params] || {}
|
126
|
+
|
127
|
+
# http body (model)
|
128
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'byte_array'])
|
129
|
+
|
130
|
+
# return_type
|
131
|
+
return_type = opts[:return_type] || 'Array<String>'
|
132
|
+
|
133
|
+
# auth_names
|
134
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
135
|
+
|
136
|
+
new_options = opts.merge(
|
137
|
+
:header_params => header_params,
|
138
|
+
:query_params => query_params,
|
139
|
+
:form_params => form_params,
|
140
|
+
:body => post_body,
|
141
|
+
:auth_names => auth_names,
|
142
|
+
:return_type => return_type
|
143
|
+
)
|
144
|
+
|
145
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
146
|
+
if @api_client.config.debugging
|
147
|
+
@api_client.config.logger.debug "API called: AttachmentControllerApi#upload_attachment_bytes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
148
|
+
end
|
149
|
+
return data, status_code, headers
|
150
|
+
end
|
151
|
+
|
152
|
+
# Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
|
153
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
88
154
|
# @param file [File] file
|
89
155
|
# @param [Hash] opts the optional parameters
|
90
|
-
# @option opts [String] :content_type
|
91
|
-
# @option opts [String] :filename
|
92
|
-
# @option opts [String] :x_filename
|
156
|
+
# @option opts [String] :content_type Optional content type of attachment
|
157
|
+
# @option opts [String] :filename Optional name of file
|
158
|
+
# @option opts [String] :x_filename Optional content type header of attachment
|
93
159
|
# @return [Array<String>]
|
94
160
|
def upload_multipart_form(file, opts = {})
|
95
161
|
data, _status_code, _headers = upload_multipart_form_with_http_info(file, opts)
|
96
162
|
data
|
97
163
|
end
|
98
164
|
|
99
|
-
# Upload an attachment for sending using Multipart Form
|
100
|
-
# When sending emails with attachments first upload each attachment with
|
165
|
+
# Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
|
166
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
101
167
|
# @param file [File] file
|
102
168
|
# @param [Hash] opts the optional parameters
|
103
|
-
# @option opts [String] :content_type
|
104
|
-
# @option opts [String] :filename
|
105
|
-
# @option opts [String] :x_filename
|
169
|
+
# @option opts [String] :content_type Optional content type of attachment
|
170
|
+
# @option opts [String] :filename Optional name of file
|
171
|
+
# @option opts [String] :x_filename Optional content type header of attachment
|
106
172
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
107
173
|
def upload_multipart_form_with_http_info(file, opts = {})
|
108
174
|
if @api_client.config.debugging
|
@@ -75,7 +75,7 @@ module MailSlurpClient
|
|
75
75
|
|
76
76
|
# Delete an email
|
77
77
|
# Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
|
78
|
-
# @param email_id [String]
|
78
|
+
# @param email_id [String] ID of email to delete
|
79
79
|
# @param [Hash] opts the optional parameters
|
80
80
|
# @return [nil]
|
81
81
|
def delete_email(email_id, opts = {})
|
@@ -85,7 +85,7 @@ module MailSlurpClient
|
|
85
85
|
|
86
86
|
# Delete an email
|
87
87
|
# Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
|
88
|
-
# @param email_id [String]
|
88
|
+
# @param email_id [String] ID of email to delete
|
89
89
|
# @param [Hash] opts the optional parameters
|
90
90
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
91
91
|
def delete_email_with_http_info(email_id, opts = {})
|
@@ -135,8 +135,8 @@ module MailSlurpClient
|
|
135
135
|
|
136
136
|
# Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
|
137
137
|
# Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
|
138
|
-
# @param attachment_id [String]
|
139
|
-
# @param email_id [String]
|
138
|
+
# @param attachment_id [String] ID of attachment
|
139
|
+
# @param email_id [String] ID of email
|
140
140
|
# @param [Hash] opts the optional parameters
|
141
141
|
# @option opts [String] :api_key Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly.
|
142
142
|
# @return [String]
|
@@ -147,8 +147,8 @@ module MailSlurpClient
|
|
147
147
|
|
148
148
|
# Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
|
149
149
|
# Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
|
150
|
-
# @param attachment_id [String]
|
151
|
-
# @param email_id [String]
|
150
|
+
# @param attachment_id [String] ID of attachment
|
151
|
+
# @param email_id [String] ID of email
|
152
152
|
# @param [Hash] opts the optional parameters
|
153
153
|
# @option opts [String] :api_key Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly.
|
154
154
|
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
@@ -206,8 +206,8 @@ module MailSlurpClient
|
|
206
206
|
|
207
207
|
# Get email attachment as base64 encoded string (alternative to binary responses)
|
208
208
|
# Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
|
209
|
-
# @param attachment_id [String]
|
210
|
-
# @param email_id [String]
|
209
|
+
# @param attachment_id [String] ID of attachment
|
210
|
+
# @param email_id [String] ID of email
|
211
211
|
# @param [Hash] opts the optional parameters
|
212
212
|
# @return [DownloadAttachmentDto]
|
213
213
|
def download_attachment_base64(attachment_id, email_id, opts = {})
|
@@ -217,8 +217,8 @@ module MailSlurpClient
|
|
217
217
|
|
218
218
|
# Get email attachment as base64 encoded string (alternative to binary responses)
|
219
219
|
# Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
|
220
|
-
# @param attachment_id [String]
|
221
|
-
# @param email_id [String]
|
220
|
+
# @param attachment_id [String] ID of attachment
|
221
|
+
# @param email_id [String] ID of email
|
222
222
|
# @param [Hash] opts the optional parameters
|
223
223
|
# @return [Array<(DownloadAttachmentDto, Integer, Hash)>] DownloadAttachmentDto data, response status code and response headers
|
224
224
|
def download_attachment_base64_with_http_info(attachment_id, email_id, opts = {})
|
@@ -274,7 +274,7 @@ module MailSlurpClient
|
|
274
274
|
|
275
275
|
# Forward email
|
276
276
|
# Forward an existing email to new recipients.
|
277
|
-
# @param email_id [String]
|
277
|
+
# @param email_id [String] ID of email
|
278
278
|
# @param forward_email_options [ForwardEmailOptions] forwardEmailOptions
|
279
279
|
# @param [Hash] opts the optional parameters
|
280
280
|
# @return [nil]
|
@@ -285,7 +285,7 @@ module MailSlurpClient
|
|
285
285
|
|
286
286
|
# Forward email
|
287
287
|
# Forward an existing email to new recipients.
|
288
|
-
# @param email_id [String]
|
288
|
+
# @param email_id [String] ID of email
|
289
289
|
# @param forward_email_options [ForwardEmailOptions] forwardEmailOptions
|
290
290
|
# @param [Hash] opts the optional parameters
|
291
291
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
@@ -342,8 +342,8 @@ module MailSlurpClient
|
|
342
342
|
|
343
343
|
# Get email attachment metadata
|
344
344
|
# Returns the metadata such as name and content-type for a given attachment and email.
|
345
|
-
# @param attachment_id [String]
|
346
|
-
# @param email_id [String]
|
345
|
+
# @param attachment_id [String] ID of attachment
|
346
|
+
# @param email_id [String] ID of email
|
347
347
|
# @param [Hash] opts the optional parameters
|
348
348
|
# @return [AttachmentMetaData]
|
349
349
|
def get_attachment_meta_data(attachment_id, email_id, opts = {})
|
@@ -353,8 +353,8 @@ module MailSlurpClient
|
|
353
353
|
|
354
354
|
# Get email attachment metadata
|
355
355
|
# Returns the metadata such as name and content-type for a given attachment and email.
|
356
|
-
# @param attachment_id [String]
|
357
|
-
# @param email_id [String]
|
356
|
+
# @param attachment_id [String] ID of attachment
|
357
|
+
# @param email_id [String] ID of email
|
358
358
|
# @param [Hash] opts the optional parameters
|
359
359
|
# @return [Array<(AttachmentMetaData, Integer, Hash)>] AttachmentMetaData data, response status code and response headers
|
360
360
|
def get_attachment_meta_data_with_http_info(attachment_id, email_id, opts = {})
|
@@ -410,7 +410,7 @@ module MailSlurpClient
|
|
410
410
|
|
411
411
|
# Get all email attachment metadata
|
412
412
|
# Returns an array of attachment metadata such as name and content-type for a given email if present.
|
413
|
-
# @param email_id [String]
|
413
|
+
# @param email_id [String] ID of email
|
414
414
|
# @param [Hash] opts the optional parameters
|
415
415
|
# @return [Array<AttachmentMetaData>]
|
416
416
|
def get_attachments(email_id, opts = {})
|
@@ -420,7 +420,7 @@ module MailSlurpClient
|
|
420
420
|
|
421
421
|
# Get all email attachment metadata
|
422
422
|
# Returns an array of attachment metadata such as name and content-type for a given email if present.
|
423
|
-
# @param email_id [String]
|
423
|
+
# @param email_id [String] ID of email
|
424
424
|
# @param [Hash] opts the optional parameters
|
425
425
|
# @return [Array<(Array<AttachmentMetaData>, Integer, Hash)>] Array<AttachmentMetaData> data, response status code and response headers
|
426
426
|
def get_attachments_with_http_info(email_id, opts = {})
|
@@ -677,7 +677,7 @@ module MailSlurpClient
|
|
677
677
|
|
678
678
|
# Get raw email string
|
679
679
|
# Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
|
680
|
-
# @param email_id [String]
|
680
|
+
# @param email_id [String] ID of email
|
681
681
|
# @param [Hash] opts the optional parameters
|
682
682
|
# @return [String]
|
683
683
|
def get_raw_email_contents(email_id, opts = {})
|
@@ -687,7 +687,7 @@ module MailSlurpClient
|
|
687
687
|
|
688
688
|
# Get raw email string
|
689
689
|
# Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
|
690
|
-
# @param email_id [String]
|
690
|
+
# @param email_id [String] ID of email
|
691
691
|
# @param [Hash] opts the optional parameters
|
692
692
|
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
693
693
|
def get_raw_email_contents_with_http_info(email_id, opts = {})
|
@@ -739,7 +739,7 @@ module MailSlurpClient
|
|
739
739
|
|
740
740
|
# Get raw email in JSON
|
741
741
|
# Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
|
742
|
-
# @param email_id [String]
|
742
|
+
# @param email_id [String] ID of email
|
743
743
|
# @param [Hash] opts the optional parameters
|
744
744
|
# @return [RawEmailJson]
|
745
745
|
def get_raw_email_json(email_id, opts = {})
|
@@ -749,7 +749,7 @@ module MailSlurpClient
|
|
749
749
|
|
750
750
|
# Get raw email in JSON
|
751
751
|
# Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
|
752
|
-
# @param email_id [String]
|
752
|
+
# @param email_id [String] ID of email
|
753
753
|
# @param [Hash] opts the optional parameters
|
754
754
|
# @return [Array<(RawEmailJson, Integer, Hash)>] RawEmailJson data, response status code and response headers
|
755
755
|
def get_raw_email_json_with_http_info(email_id, opts = {})
|
@@ -857,7 +857,7 @@ module MailSlurpClient
|
|
857
857
|
|
858
858
|
# Validate email
|
859
859
|
# Validate the HTML content of email if HTML is found. Considered valid if no HTML.
|
860
|
-
# @param email_id [String]
|
860
|
+
# @param email_id [String] ID of email
|
861
861
|
# @param [Hash] opts the optional parameters
|
862
862
|
# @return [ValidationDto]
|
863
863
|
def validate_email(email_id, opts = {})
|
@@ -867,7 +867,7 @@ module MailSlurpClient
|
|
867
867
|
|
868
868
|
# Validate email
|
869
869
|
# Validate the HTML content of email if HTML is found. Considered valid if no HTML.
|
870
|
-
# @param email_id [String]
|
870
|
+
# @param email_id [String] ID of email
|
871
871
|
# @param [Hash] opts the optional parameters
|
872
872
|
# @return [Array<(ValidationDto, Integer, Hash)>] ValidationDto data, response status code and response headers
|
873
873
|
def validate_email_with_http_info(email_id, opts = {})
|
@@ -15,7 +15,7 @@ require 'date'
|
|
15
15
|
module MailSlurpClient
|
16
16
|
# Options for uploading files for attachments. When sending emails with the API that require attachments first upload each attachment. Then use the returned attachment ID in your `SendEmailOptions` when sending an email. This way you can use attachments multiple times once they have been uploaded.
|
17
17
|
class UploadAttachmentOptions
|
18
|
-
# Base64 encoded string of file contents
|
18
|
+
# Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string.
|
19
19
|
attr_accessor :base64_contents
|
20
20
|
|
21
21
|
# Optional contentType for file. For instance `application/pdf`
|
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: 8.2.
|
4
|
+
version: 8.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mailslurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-20 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.
|