mailslurp_client 8.3.1 → 8.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailslurp_client.rb +5 -2
- data/lib/mailslurp_client/api/alias_controller_api.rb +35 -97
- data/lib/mailslurp_client/api/email_controller_api.rb +70 -0
- data/lib/mailslurp_client/api/form_controller_api.rb +4 -7
- data/lib/mailslurp_client/api/wait_for_controller_api.rb +73 -0
- data/lib/mailslurp_client/models/alias_dto.rb +303 -0
- data/lib/mailslurp_client/models/alias_projection.rb +300 -0
- data/lib/mailslurp_client/models/{create_owned_alias_options.rb → create_alias_options.rb} +13 -13
- data/lib/mailslurp_client/models/email.rb +11 -1
- data/lib/mailslurp_client/models/model_alias.rb +20 -10
- data/lib/mailslurp_client/models/page_alias.rb +1 -1
- data/lib/mailslurp_client/models/reply_to_email_options.rb +314 -0
- data/lib/mailslurp_client/models/sent_email_dto.rb +10 -1
- data/lib/mailslurp_client/models/{create_anonymous_alias_options.rb → update_alias_options.rb} +12 -12
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae83a71f4c8140c751543b86a6798211fab9b535017eb58e39127c232a63dbea
|
4
|
+
data.tar.gz: a47c552fc604c48cf8ebe33912d1f312f0d2f3579df90b45732db83f144b974a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 517f0cb1ee268bb3c25dc8c73a26c2361401a206c1407c85cfafbfb13feb021ed7af0500b48c81996a68d0380c14268b3a9539d525272ffd22b9d678cb8bbe2d
|
7
|
+
data.tar.gz: cb9241aade524718699f526f0f09344d227fcf5618c4c1cd20fcff166174bdcd0f1a90f469441c4def3050829fe3be62a003fbc0394034d8d57301eb6c2181d7
|
data/lib/mailslurp_client.rb
CHANGED
@@ -17,18 +17,19 @@ require 'mailslurp_client/version'
|
|
17
17
|
require 'mailslurp_client/configuration'
|
18
18
|
|
19
19
|
# Models
|
20
|
+
require 'mailslurp_client/models/alias_dto'
|
21
|
+
require 'mailslurp_client/models/alias_projection'
|
20
22
|
require 'mailslurp_client/models/attachment_meta_data'
|
21
23
|
require 'mailslurp_client/models/basic_auth_options'
|
22
24
|
require 'mailslurp_client/models/bulk_send_email_options'
|
23
25
|
require 'mailslurp_client/models/contact_dto'
|
24
26
|
require 'mailslurp_client/models/contact_projection'
|
25
27
|
require 'mailslurp_client/models/content_match_options'
|
26
|
-
require 'mailslurp_client/models/
|
28
|
+
require 'mailslurp_client/models/create_alias_options'
|
27
29
|
require 'mailslurp_client/models/create_contact_options'
|
28
30
|
require 'mailslurp_client/models/create_domain_options'
|
29
31
|
require 'mailslurp_client/models/create_group_options'
|
30
32
|
require 'mailslurp_client/models/create_inbox_dto'
|
31
|
-
require 'mailslurp_client/models/create_owned_alias_options'
|
32
33
|
require 'mailslurp_client/models/create_template_options'
|
33
34
|
require 'mailslurp_client/models/create_webhook_options'
|
34
35
|
require 'mailslurp_client/models/dns_lookup_options'
|
@@ -68,6 +69,7 @@ require 'mailslurp_client/models/page_template_projection'
|
|
68
69
|
require 'mailslurp_client/models/page_webhook_projection'
|
69
70
|
require 'mailslurp_client/models/pageable'
|
70
71
|
require 'mailslurp_client/models/raw_email_json'
|
72
|
+
require 'mailslurp_client/models/reply_to_email_options'
|
71
73
|
require 'mailslurp_client/models/send_email_options'
|
72
74
|
require 'mailslurp_client/models/sent_email_dto'
|
73
75
|
require 'mailslurp_client/models/sent_email_projection'
|
@@ -78,6 +80,7 @@ require 'mailslurp_client/models/template_dto'
|
|
78
80
|
require 'mailslurp_client/models/template_projection'
|
79
81
|
require 'mailslurp_client/models/template_variable'
|
80
82
|
require 'mailslurp_client/models/unread_count'
|
83
|
+
require 'mailslurp_client/models/update_alias_options'
|
81
84
|
require 'mailslurp_client/models/update_group_contacts'
|
82
85
|
require 'mailslurp_client/models/update_inbox_options'
|
83
86
|
require 'mailslurp_client/models/upload_attachment_options'
|
@@ -19,28 +19,28 @@ module MailSlurpClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
# Create an email alias
|
23
|
-
#
|
24
|
-
# @param
|
22
|
+
# Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
|
23
|
+
# Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
|
24
|
+
# @param create_alias_options [CreateAliasOptions] createAliasOptions
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
|
-
# @return [
|
27
|
-
def create_alias(
|
28
|
-
create_alias_with_http_info(
|
29
|
-
|
26
|
+
# @return [AliasDto]
|
27
|
+
def create_alias(create_alias_options, opts = {})
|
28
|
+
data, _status_code, _headers = create_alias_with_http_info(create_alias_options, opts)
|
29
|
+
data
|
30
30
|
end
|
31
31
|
|
32
|
-
# Create an email alias
|
33
|
-
#
|
34
|
-
# @param
|
32
|
+
# Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
|
33
|
+
# Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
|
34
|
+
# @param create_alias_options [CreateAliasOptions] createAliasOptions
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [Array<(
|
37
|
-
def create_alias_with_http_info(
|
36
|
+
# @return [Array<(AliasDto, Integer, Hash)>] AliasDto data, response status code and response headers
|
37
|
+
def create_alias_with_http_info(create_alias_options, opts = {})
|
38
38
|
if @api_client.config.debugging
|
39
39
|
@api_client.config.logger.debug 'Calling API: AliasControllerApi.create_alias ...'
|
40
40
|
end
|
41
|
-
# verify the required parameter '
|
42
|
-
if @api_client.config.client_side_validation &&
|
43
|
-
fail ArgumentError, "Missing the required parameter '
|
41
|
+
# verify the required parameter 'create_alias_options' is set
|
42
|
+
if @api_client.config.client_side_validation && create_alias_options.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_alias_options' when calling AliasControllerApi.create_alias"
|
44
44
|
end
|
45
45
|
# resource path
|
46
46
|
local_var_path = '/aliases'
|
@@ -59,10 +59,10 @@ module MailSlurpClient
|
|
59
59
|
form_params = opts[:form_params] || {}
|
60
60
|
|
61
61
|
# http body (model)
|
62
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
62
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_alias_options)
|
63
63
|
|
64
64
|
# return_type
|
65
|
-
return_type = opts[:return_type]
|
65
|
+
return_type = opts[:return_type] || 'AliasDto'
|
66
66
|
|
67
67
|
# auth_names
|
68
68
|
auth_names = opts[:auth_names] || ['API_KEY']
|
@@ -83,69 +83,7 @@ module MailSlurpClient
|
|
83
83
|
return data, status_code, headers
|
84
84
|
end
|
85
85
|
|
86
|
-
#
|
87
|
-
# @param create_anonymous_alias_options [CreateAnonymousAliasOptions] createAnonymousAliasOptions
|
88
|
-
# @param [Hash] opts the optional parameters
|
89
|
-
# @return [ModelAlias]
|
90
|
-
def create_anonymous_alias(create_anonymous_alias_options, opts = {})
|
91
|
-
data, _status_code, _headers = create_anonymous_alias_with_http_info(create_anonymous_alias_options, opts)
|
92
|
-
data
|
93
|
-
end
|
94
|
-
|
95
|
-
# Create an anonymous email alias
|
96
|
-
# @param create_anonymous_alias_options [CreateAnonymousAliasOptions] createAnonymousAliasOptions
|
97
|
-
# @param [Hash] opts the optional parameters
|
98
|
-
# @return [Array<(ModelAlias, Integer, Hash)>] ModelAlias data, response status code and response headers
|
99
|
-
def create_anonymous_alias_with_http_info(create_anonymous_alias_options, opts = {})
|
100
|
-
if @api_client.config.debugging
|
101
|
-
@api_client.config.logger.debug 'Calling API: AliasControllerApi.create_anonymous_alias ...'
|
102
|
-
end
|
103
|
-
# verify the required parameter 'create_anonymous_alias_options' is set
|
104
|
-
if @api_client.config.client_side_validation && create_anonymous_alias_options.nil?
|
105
|
-
fail ArgumentError, "Missing the required parameter 'create_anonymous_alias_options' when calling AliasControllerApi.create_anonymous_alias"
|
106
|
-
end
|
107
|
-
# resource path
|
108
|
-
local_var_path = '/aliases/anonymous'
|
109
|
-
|
110
|
-
# query parameters
|
111
|
-
query_params = opts[:query_params] || {}
|
112
|
-
|
113
|
-
# header parameters
|
114
|
-
header_params = opts[:header_params] || {}
|
115
|
-
# HTTP header 'Accept' (if needed)
|
116
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
117
|
-
# HTTP header 'Content-Type'
|
118
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
119
|
-
|
120
|
-
# form parameters
|
121
|
-
form_params = opts[:form_params] || {}
|
122
|
-
|
123
|
-
# http body (model)
|
124
|
-
post_body = opts[:body] || @api_client.object_to_http_body(create_anonymous_alias_options)
|
125
|
-
|
126
|
-
# return_type
|
127
|
-
return_type = opts[:return_type] || 'ModelAlias'
|
128
|
-
|
129
|
-
# auth_names
|
130
|
-
auth_names = opts[:auth_names] || ['API_KEY']
|
131
|
-
|
132
|
-
new_options = opts.merge(
|
133
|
-
:header_params => header_params,
|
134
|
-
:query_params => query_params,
|
135
|
-
:form_params => form_params,
|
136
|
-
:body => post_body,
|
137
|
-
:auth_names => auth_names,
|
138
|
-
:return_type => return_type
|
139
|
-
)
|
140
|
-
|
141
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
142
|
-
if @api_client.config.debugging
|
143
|
-
@api_client.config.logger.debug "API called: AliasControllerApi#create_anonymous_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
144
|
-
end
|
145
|
-
return data, status_code, headers
|
146
|
-
end
|
147
|
-
|
148
|
-
# Delete an owned alias
|
86
|
+
# Delete an email alias
|
149
87
|
# @param alias_id [String] aliasId
|
150
88
|
# @param [Hash] opts the optional parameters
|
151
89
|
# @return [nil]
|
@@ -154,7 +92,7 @@ module MailSlurpClient
|
|
154
92
|
nil
|
155
93
|
end
|
156
94
|
|
157
|
-
# Delete an
|
95
|
+
# Delete an email alias
|
158
96
|
# @param alias_id [String] aliasId
|
159
97
|
# @param [Hash] opts the optional parameters
|
160
98
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
@@ -207,7 +145,7 @@ module MailSlurpClient
|
|
207
145
|
# Get an email alias by ID
|
208
146
|
# @param alias_id [String] aliasId
|
209
147
|
# @param [Hash] opts the optional parameters
|
210
|
-
# @return [
|
148
|
+
# @return [AliasDto]
|
211
149
|
def get_alias(alias_id, opts = {})
|
212
150
|
data, _status_code, _headers = get_alias_with_http_info(alias_id, opts)
|
213
151
|
data
|
@@ -217,7 +155,7 @@ module MailSlurpClient
|
|
217
155
|
# Get an email alias by ID
|
218
156
|
# @param alias_id [String] aliasId
|
219
157
|
# @param [Hash] opts the optional parameters
|
220
|
-
# @return [Array<(
|
158
|
+
# @return [Array<(AliasDto, Integer, Hash)>] AliasDto data, response status code and response headers
|
221
159
|
def get_alias_with_http_info(alias_id, opts = {})
|
222
160
|
if @api_client.config.debugging
|
223
161
|
@api_client.config.logger.debug 'Calling API: AliasControllerApi.get_alias ...'
|
@@ -244,7 +182,7 @@ module MailSlurpClient
|
|
244
182
|
post_body = opts[:body]
|
245
183
|
|
246
184
|
# return_type
|
247
|
-
return_type = opts[:return_type] || '
|
185
|
+
return_type = opts[:return_type] || 'AliasDto'
|
248
186
|
|
249
187
|
# auth_names
|
250
188
|
auth_names = opts[:auth_names] || ['API_KEY']
|
@@ -265,7 +203,7 @@ module MailSlurpClient
|
|
265
203
|
return data, status_code, headers
|
266
204
|
end
|
267
205
|
|
268
|
-
# Get all email aliases
|
206
|
+
# Get all email aliases you have created
|
269
207
|
# Get all email aliases in paginated form
|
270
208
|
# @param [Hash] opts the optional parameters
|
271
209
|
# @option opts [Integer] :page Optional page index in alias list pagination (default to 0)
|
@@ -277,7 +215,7 @@ module MailSlurpClient
|
|
277
215
|
data
|
278
216
|
end
|
279
217
|
|
280
|
-
# Get all email aliases
|
218
|
+
# Get all email aliases you have created
|
281
219
|
# Get all email aliases in paginated form
|
282
220
|
# @param [Hash] opts the optional parameters
|
283
221
|
# @option opts [Integer] :page Optional page index in alias list pagination
|
@@ -334,22 +272,22 @@ module MailSlurpClient
|
|
334
272
|
return data, status_code, headers
|
335
273
|
end
|
336
274
|
|
337
|
-
# Update an
|
275
|
+
# Update an email alias
|
338
276
|
# @param alias_id [String] aliasId
|
339
|
-
# @param
|
277
|
+
# @param update_alias_options [UpdateAliasOptions] updateAliasOptions
|
340
278
|
# @param [Hash] opts the optional parameters
|
341
279
|
# @return [nil]
|
342
|
-
def update_alias(alias_id,
|
343
|
-
update_alias_with_http_info(alias_id,
|
280
|
+
def update_alias(alias_id, update_alias_options, opts = {})
|
281
|
+
update_alias_with_http_info(alias_id, update_alias_options, opts)
|
344
282
|
nil
|
345
283
|
end
|
346
284
|
|
347
|
-
# Update an
|
285
|
+
# Update an email alias
|
348
286
|
# @param alias_id [String] aliasId
|
349
|
-
# @param
|
287
|
+
# @param update_alias_options [UpdateAliasOptions] updateAliasOptions
|
350
288
|
# @param [Hash] opts the optional parameters
|
351
289
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
352
|
-
def update_alias_with_http_info(alias_id,
|
290
|
+
def update_alias_with_http_info(alias_id, update_alias_options, opts = {})
|
353
291
|
if @api_client.config.debugging
|
354
292
|
@api_client.config.logger.debug 'Calling API: AliasControllerApi.update_alias ...'
|
355
293
|
end
|
@@ -357,9 +295,9 @@ module MailSlurpClient
|
|
357
295
|
if @api_client.config.client_side_validation && alias_id.nil?
|
358
296
|
fail ArgumentError, "Missing the required parameter 'alias_id' when calling AliasControllerApi.update_alias"
|
359
297
|
end
|
360
|
-
# verify the required parameter '
|
361
|
-
if @api_client.config.client_side_validation &&
|
362
|
-
fail ArgumentError, "Missing the required parameter '
|
298
|
+
# verify the required parameter 'update_alias_options' is set
|
299
|
+
if @api_client.config.client_side_validation && update_alias_options.nil?
|
300
|
+
fail ArgumentError, "Missing the required parameter 'update_alias_options' when calling AliasControllerApi.update_alias"
|
363
301
|
end
|
364
302
|
# resource path
|
365
303
|
local_var_path = '/aliases/{aliasId}'.sub('{' + 'aliasId' + '}', CGI.escape(alias_id.to_s))
|
@@ -378,7 +316,7 @@ module MailSlurpClient
|
|
378
316
|
form_params = opts[:form_params] || {}
|
379
317
|
|
380
318
|
# http body (model)
|
381
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
319
|
+
post_body = opts[:body] || @api_client.object_to_http_body(update_alias_options)
|
382
320
|
|
383
321
|
# return_type
|
384
322
|
return_type = opts[:return_type]
|
@@ -925,6 +925,76 @@ module MailSlurpClient
|
|
925
925
|
return data, status_code, headers
|
926
926
|
end
|
927
927
|
|
928
|
+
# Reply to an email
|
929
|
+
# Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
|
930
|
+
# @param email_id [String] emailId
|
931
|
+
# @param reply_to_email_options [ReplyToEmailOptions] replyToEmailOptions
|
932
|
+
# @param [Hash] opts the optional parameters
|
933
|
+
# @return [SentEmailDto]
|
934
|
+
def reply_to_email(email_id, reply_to_email_options, opts = {})
|
935
|
+
data, _status_code, _headers = reply_to_email_with_http_info(email_id, reply_to_email_options, opts)
|
936
|
+
data
|
937
|
+
end
|
938
|
+
|
939
|
+
# Reply to an email
|
940
|
+
# Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
|
941
|
+
# @param email_id [String] emailId
|
942
|
+
# @param reply_to_email_options [ReplyToEmailOptions] replyToEmailOptions
|
943
|
+
# @param [Hash] opts the optional parameters
|
944
|
+
# @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
|
945
|
+
def reply_to_email_with_http_info(email_id, reply_to_email_options, opts = {})
|
946
|
+
if @api_client.config.debugging
|
947
|
+
@api_client.config.logger.debug 'Calling API: EmailControllerApi.reply_to_email ...'
|
948
|
+
end
|
949
|
+
# verify the required parameter 'email_id' is set
|
950
|
+
if @api_client.config.client_side_validation && email_id.nil?
|
951
|
+
fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.reply_to_email"
|
952
|
+
end
|
953
|
+
# verify the required parameter 'reply_to_email_options' is set
|
954
|
+
if @api_client.config.client_side_validation && reply_to_email_options.nil?
|
955
|
+
fail ArgumentError, "Missing the required parameter 'reply_to_email_options' when calling EmailControllerApi.reply_to_email"
|
956
|
+
end
|
957
|
+
# resource path
|
958
|
+
local_var_path = '/emails/{emailId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
|
959
|
+
|
960
|
+
# query parameters
|
961
|
+
query_params = opts[:query_params] || {}
|
962
|
+
|
963
|
+
# header parameters
|
964
|
+
header_params = opts[:header_params] || {}
|
965
|
+
# HTTP header 'Accept' (if needed)
|
966
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
967
|
+
# HTTP header 'Content-Type'
|
968
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
969
|
+
|
970
|
+
# form parameters
|
971
|
+
form_params = opts[:form_params] || {}
|
972
|
+
|
973
|
+
# http body (model)
|
974
|
+
post_body = opts[:body] || @api_client.object_to_http_body(reply_to_email_options)
|
975
|
+
|
976
|
+
# return_type
|
977
|
+
return_type = opts[:return_type] || 'SentEmailDto'
|
978
|
+
|
979
|
+
# auth_names
|
980
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
981
|
+
|
982
|
+
new_options = opts.merge(
|
983
|
+
:header_params => header_params,
|
984
|
+
:query_params => query_params,
|
985
|
+
:form_params => form_params,
|
986
|
+
:body => post_body,
|
987
|
+
:auth_names => auth_names,
|
988
|
+
:return_type => return_type
|
989
|
+
)
|
990
|
+
|
991
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
992
|
+
if @api_client.config.debugging
|
993
|
+
@api_client.config.logger.debug "API called: EmailControllerApi#reply_to_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
994
|
+
end
|
995
|
+
return data, status_code, headers
|
996
|
+
end
|
997
|
+
|
928
998
|
# Validate email
|
929
999
|
# Validate the HTML content of email if HTML is found. Considered valid if no HTML.
|
930
1000
|
# @param email_id [String] ID of email
|
@@ -20,15 +20,14 @@ module MailSlurpClient
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Submit a form to be parsed and sent as an email to an address determined by the form fields
|
23
|
-
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address
|
23
|
+
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://api.mailslurp.com/forms?_to=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
25
|
# @option opts [String] :_email_address Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later.
|
26
26
|
# @option opts [String] :_redirect_to Optional URL to redirect form submitter to after submission. If not present user will see a success message.
|
27
27
|
# @option opts [String] :_spam_check Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored.
|
28
28
|
# @option opts [String] :_subject Optional subject of the email that will be sent.
|
29
29
|
# @option opts [String] :_success_message Optional success message to display if no _redirectTo present.
|
30
|
-
# @option opts [String] :_to The email address that submitted form should be sent to.
|
31
|
-
# @option opts [String] :_to_alias ID of an email alias to that form should be sent to. Aliases must be created before submission and can be used to hide an email address and reduce spam.
|
30
|
+
# @option opts [String] :_to The email address that submitted form should be sent to.
|
32
31
|
# @option opts [String] :other_parameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent.
|
33
32
|
# @return [String]
|
34
33
|
def submit_form(opts = {})
|
@@ -37,15 +36,14 @@ module MailSlurpClient
|
|
37
36
|
end
|
38
37
|
|
39
38
|
# Submit a form to be parsed and sent as an email to an address determined by the form fields
|
40
|
-
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address
|
39
|
+
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://api.mailslurp.com/forms?_to=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
|
41
40
|
# @param [Hash] opts the optional parameters
|
42
41
|
# @option opts [String] :_email_address Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later.
|
43
42
|
# @option opts [String] :_redirect_to Optional URL to redirect form submitter to after submission. If not present user will see a success message.
|
44
43
|
# @option opts [String] :_spam_check Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored.
|
45
44
|
# @option opts [String] :_subject Optional subject of the email that will be sent.
|
46
45
|
# @option opts [String] :_success_message Optional success message to display if no _redirectTo present.
|
47
|
-
# @option opts [String] :_to The email address that submitted form should be sent to.
|
48
|
-
# @option opts [String] :_to_alias ID of an email alias to that form should be sent to. Aliases must be created before submission and can be used to hide an email address and reduce spam.
|
46
|
+
# @option opts [String] :_to The email address that submitted form should be sent to.
|
49
47
|
# @option opts [String] :other_parameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent.
|
50
48
|
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
51
49
|
def submit_form_with_http_info(opts = {})
|
@@ -73,7 +71,6 @@ module MailSlurpClient
|
|
73
71
|
form_params['_subject'] = opts[:'_subject'] if !opts[:'_subject'].nil?
|
74
72
|
form_params['_successMessage'] = opts[:'_success_message'] if !opts[:'_success_message'].nil?
|
75
73
|
form_params['_to'] = opts[:'_to'] if !opts[:'_to'].nil?
|
76
|
-
form_params['_toAlias'] = opts[:'_to_alias'] if !opts[:'_to_alias'].nil?
|
77
74
|
form_params['otherParameters'] = opts[:'other_parameters'] if !opts[:'other_parameters'].nil?
|
78
75
|
|
79
76
|
# http body (model)
|
@@ -288,6 +288,79 @@ module MailSlurpClient
|
|
288
288
|
return data, status_code, headers
|
289
289
|
end
|
290
290
|
|
291
|
+
# Wait for or return the first email that matches proved MatchOptions array
|
292
|
+
# Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
|
293
|
+
# @param match_options [MatchOptions] matchOptions
|
294
|
+
# @param [Hash] opts the optional parameters
|
295
|
+
# @option opts [String] :inbox_id Id of the inbox we are matching an email for
|
296
|
+
# @option opts [Integer] :timeout Max milliseconds to wait
|
297
|
+
# @option opts [Boolean] :unread_only Optional filter for unread only (default to false)
|
298
|
+
# @return [Email]
|
299
|
+
def wait_for_matching_first_email(match_options, opts = {})
|
300
|
+
data, _status_code, _headers = wait_for_matching_first_email_with_http_info(match_options, opts)
|
301
|
+
data
|
302
|
+
end
|
303
|
+
|
304
|
+
# Wait for or return the first email that matches proved MatchOptions array
|
305
|
+
# Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
|
306
|
+
# @param match_options [MatchOptions] matchOptions
|
307
|
+
# @param [Hash] opts the optional parameters
|
308
|
+
# @option opts [String] :inbox_id Id of the inbox we are matching an email for
|
309
|
+
# @option opts [Integer] :timeout Max milliseconds to wait
|
310
|
+
# @option opts [Boolean] :unread_only Optional filter for unread only
|
311
|
+
# @return [Array<(Email, Integer, Hash)>] Email data, response status code and response headers
|
312
|
+
def wait_for_matching_first_email_with_http_info(match_options, opts = {})
|
313
|
+
if @api_client.config.debugging
|
314
|
+
@api_client.config.logger.debug 'Calling API: WaitForControllerApi.wait_for_matching_first_email ...'
|
315
|
+
end
|
316
|
+
# verify the required parameter 'match_options' is set
|
317
|
+
if @api_client.config.client_side_validation && match_options.nil?
|
318
|
+
fail ArgumentError, "Missing the required parameter 'match_options' when calling WaitForControllerApi.wait_for_matching_first_email"
|
319
|
+
end
|
320
|
+
# resource path
|
321
|
+
local_var_path = '/waitForMatchingFirstEmail'
|
322
|
+
|
323
|
+
# query parameters
|
324
|
+
query_params = opts[:query_params] || {}
|
325
|
+
query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
|
326
|
+
query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
|
327
|
+
query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
|
328
|
+
|
329
|
+
# header parameters
|
330
|
+
header_params = opts[:header_params] || {}
|
331
|
+
# HTTP header 'Accept' (if needed)
|
332
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
333
|
+
# HTTP header 'Content-Type'
|
334
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
335
|
+
|
336
|
+
# form parameters
|
337
|
+
form_params = opts[:form_params] || {}
|
338
|
+
|
339
|
+
# http body (model)
|
340
|
+
post_body = opts[:body] || @api_client.object_to_http_body(match_options)
|
341
|
+
|
342
|
+
# return_type
|
343
|
+
return_type = opts[:return_type] || 'Email'
|
344
|
+
|
345
|
+
# auth_names
|
346
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
347
|
+
|
348
|
+
new_options = opts.merge(
|
349
|
+
:header_params => header_params,
|
350
|
+
:query_params => query_params,
|
351
|
+
:form_params => form_params,
|
352
|
+
:body => post_body,
|
353
|
+
:auth_names => auth_names,
|
354
|
+
:return_type => return_type
|
355
|
+
)
|
356
|
+
|
357
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
358
|
+
if @api_client.config.debugging
|
359
|
+
@api_client.config.logger.debug "API called: WaitForControllerApi#wait_for_matching_first_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
360
|
+
end
|
361
|
+
return data, status_code, headers
|
362
|
+
end
|
363
|
+
|
291
364
|
# Wait for or fetch the email with a given index in the inbox specified
|
292
365
|
# If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
|
293
366
|
# @param [Hash] opts the optional parameters
|