Class: MailSlurpClient::EmailControllerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/api/email_controller_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EmailControllerApi

Returns a new instance of EmailControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#apply_imap_flag_operation(email_id, imap_flag_operation_options, opts = {}) ⇒ EmailPreview

Set IMAP flags associated with a message. Only supports '\Seen' flag. Applies RFC3501 IMAP flag operations on a message. Current implementation supports read/unread semantics via the `\\Seen` flag only.

Parameters:

  • email_id (String)
  • imap_flag_operation_options (ImapFlagOperationOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 28

def apply_imap_flag_operation(email_id, imap_flag_operation_options, opts = {})
  data, _status_code, _headers = apply_imap_flag_operation_with_http_info(email_id, imap_flag_operation_options, opts)
  data
end

#apply_imap_flag_operation_with_http_info(email_id, imap_flag_operation_options, opts = {}) ⇒ Array<(EmailPreview, Integer, Hash)>

Set IMAP flags associated with a message. Only supports &#39;\Seen&#39; flag. Applies RFC3501 IMAP flag operations on a message. Current implementation supports read/unread semantics via the &#x60;\\Seen&#x60; flag only.

Parameters:

  • email_id (String)
  • imap_flag_operation_options (ImapFlagOperationOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailPreview, Integer, Hash)>)

    EmailPreview data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 39

def apply_imap_flag_operation_with_http_info(email_id, imap_flag_operation_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.apply_imap_flag_operation ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.apply_imap_flag_operation"
  end
  # verify the required parameter 'imap_flag_operation_options' is set
  if @api_client.config.client_side_validation && imap_flag_operation_options.nil?
    fail ArgumentError, "Missing the required parameter 'imap_flag_operation_options' when calling EmailControllerApi.apply_imap_flag_operation"
  end
  # resource path
  local_var_path = '/emails/{emailId}/imap-flag-operation'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(imap_flag_operation_options) 

  # return_type
  return_type = opts[:return_type] || 'EmailPreview' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#apply_imap_flag_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#can_send(inbox_id, send_email_options, opts = {}) ⇒ CanSendEmailResults

Check whether an email send would be accepted Validates sender/inbox context and recipient eligibility before attempting a send. Useful for preflight checks in UI or test workflows.

Parameters:

  • inbox_id (String)

    ID of the inbox you want to send the email from

  • send_email_options (SendEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



98
99
100
101
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 98

def can_send(inbox_id, send_email_options, opts = {})
  data, _status_code, _headers = can_send_with_http_info(inbox_id, send_email_options, opts)
  data
end

#can_send_with_http_info(inbox_id, send_email_options, opts = {}) ⇒ Array<(CanSendEmailResults, Integer, Hash)>

Check whether an email send would be accepted Validates sender/inbox context and recipient eligibility before attempting a send. Useful for preflight checks in UI or test workflows.

Parameters:

  • inbox_id (String)

    ID of the inbox you want to send the email from

  • send_email_options (SendEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CanSendEmailResults, Integer, Hash)>)

    CanSendEmailResults data, response status code and response headers



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 109

def can_send_with_http_info(inbox_id, send_email_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.can_send ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling EmailControllerApi.can_send"
  end
  # verify the required parameter 'send_email_options' is set
  if @api_client.config.client_side_validation && send_email_options.nil?
    fail ArgumentError, "Missing the required parameter 'send_email_options' when calling EmailControllerApi.can_send"
  end
  # resource path
  local_var_path = '/emails/can-send'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = inbox_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(send_email_options) 

  # return_type
  return_type = opts[:return_type] || 'CanSendEmailResults' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#can_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_email_audit1(email_id, opts = {}) ⇒ EmailAuditAnalysisResult

Run aggregate email audit for a stored email Runs the same message-level audit bundle used by the email audit dashboard in one request. Combines content checks, HTML validation, compatibility analysis, and reputation verdict rollup when available.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



168
169
170
171
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 168

def check_email_audit1(email_id, opts = {})
  data, _status_code, _headers = check_email_audit1_with_http_info(email_id, opts)
  data
end

#check_email_audit1_with_http_info(email_id, opts = {}) ⇒ Array<(EmailAuditAnalysisResult, Integer, Hash)>

Run aggregate email audit for a stored email Runs the same message-level audit bundle used by the email audit dashboard in one request. Combines content checks, HTML validation, compatibility analysis, and reputation verdict rollup when available.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailAuditAnalysisResult, Integer, Hash)>)

    EmailAuditAnalysisResult data, response status code and response headers



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 178

def check_email_audit1_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.check_email_audit1 ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.check_email_audit1"
  end
  # resource path
  local_var_path = '/emails/{emailId}/check-email-audit'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailAuditAnalysisResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#check_email_audit1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_email_body(email_id, opts = {}) ⇒ CheckEmailBodyResults

Check email body for broken links, images, and spelling issues Runs content quality checks against hydrated email body content. This endpoint performs outbound HTTP checks for linked resources, so avoid use with sensitive or stateful URLs.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



230
231
232
233
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 230

def check_email_body(email_id, opts = {})
  data, _status_code, _headers = check_email_body_with_http_info(email_id, opts)
  data
end

#check_email_body_feature_support(email_id, opts = {}) ⇒ CheckEmailBodyFeatureSupportResults

Check client support for features used in a stored email body Detects HTML/CSS features in the target email body and reports compatibility across major email clients and devices.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



292
293
294
295
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 292

def check_email_body_feature_support(email_id, opts = {})
  data, _status_code, _headers = check_email_body_feature_support_with_http_info(email_id, opts)
  data
end

#check_email_body_feature_support_with_http_info(email_id, opts = {}) ⇒ Array<(CheckEmailBodyFeatureSupportResults, Integer, Hash)>

Check client support for features used in a stored email body Detects HTML/CSS features in the target email body and reports compatibility across major email clients and devices.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 302

def check_email_body_feature_support_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.check_email_body_feature_support ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.check_email_body_feature_support"
  end
  # resource path
  local_var_path = '/emails/{emailId}/check-email-body-feature-support'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'CheckEmailBodyFeatureSupportResults' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#check_email_body_feature_support\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_email_body_with_http_info(email_id, opts = {}) ⇒ Array<(CheckEmailBodyResults, Integer, Hash)>

Check email body for broken links, images, and spelling issues Runs content quality checks against hydrated email body content. This endpoint performs outbound HTTP checks for linked resources, so avoid use with sensitive or stateful URLs.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CheckEmailBodyResults, Integer, Hash)>)

    CheckEmailBodyResults data, response status code and response headers



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 240

def check_email_body_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.check_email_body ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.check_email_body"
  end
  # resource path
  local_var_path = '/emails/{emailId}/check-email-body'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'CheckEmailBodyResults' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#check_email_body\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_email_client_support(check_email_client_support_options, opts = {}) ⇒ CheckEmailClientSupportResults

Check email-client support for a provided HTML body Evaluates HTML/CSS features in the supplied body and reports support coverage across major email clients and platforms.

Parameters:

Returns:



354
355
356
357
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 354

def check_email_client_support(check_email_client_support_options, opts = {})
  data, _status_code, _headers = check_email_client_support_with_http_info(check_email_client_support_options, opts)
  data
end

#check_email_client_support_with_http_info(check_email_client_support_options, opts = {}) ⇒ Array<(CheckEmailClientSupportResults, Integer, Hash)>

Check email-client support for a provided HTML body Evaluates HTML/CSS features in the supplied body and reports support coverage across major email clients and platforms.

Parameters:

Returns:



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 364

def check_email_client_support_with_http_info(check_email_client_support_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.check_email_client_support ...'
  end
  # verify the required parameter 'check_email_client_support_options' is set
  if @api_client.config.client_side_validation && check_email_client_support_options.nil?
    fail ArgumentError, "Missing the required parameter 'check_email_client_support_options' when calling EmailControllerApi.check_email_client_support"
  end
  # resource path
  local_var_path = '/emails/check-email-client-support'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(check_email_client_support_options) 

  # return_type
  return_type = opts[:return_type] || 'CheckEmailClientSupportResults' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#check_email_client_support\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_email_audit_for_email(email_id, opts = {}) ⇒ EmailAuditDto

Persist aggregate email audit for a stored email Runs the aggregate audit bundle for the target email and stores the resulting audit record for later review and history tracking.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



418
419
420
421
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 418

def create_email_audit_for_email(email_id, opts = {})
  data, _status_code, _headers = create_email_audit_for_email_with_http_info(email_id, opts)
  data
end

#create_email_audit_for_email_with_http_info(email_id, opts = {}) ⇒ Array<(EmailAuditDto, Integer, Hash)>

Persist aggregate email audit for a stored email Runs the aggregate audit bundle for the target email and stores the resulting audit record for later review and history tracking.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailAuditDto, Integer, Hash)>)

    EmailAuditDto data, response status code and response headers



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 428

def create_email_audit_for_email_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.create_email_audit_for_email ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.create_email_audit_for_email"
  end
  # resource path
  local_var_path = '/emails/{emailId}/audit'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailAuditDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#create_email_audit_for_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_all_emails(opts = {}) ⇒ nil

Delete all emails in all inboxes. Deletes all emails for the authenticated account context. This operation is destructive and cannot be undone.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


479
480
481
482
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 479

def delete_all_emails(opts = {})
  delete_all_emails_with_http_info(opts)
  nil
end

#delete_all_emails_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete all emails in all inboxes. Deletes all emails for the authenticated account context. This operation is destructive and cannot be undone.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 488

def delete_all_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.delete_all_emails ...'
  end
  # resource path
  local_var_path = '/emails'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#delete_all_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_email(email_id, opts = {}) ⇒ nil

Delete an email Deletes a single email from account scope. Operation is destructive and not reversible.

Parameters:

  • email_id (String)

    ID of email to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


534
535
536
537
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 534

def delete_email(email_id, opts = {})
  delete_email_with_http_info(email_id, opts)
  nil
end

#delete_email_with_http_info(email_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an email Deletes a single email from account scope. Operation is destructive and not reversible.

Parameters:

  • email_id (String)

    ID of email to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 544

def delete_email_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.delete_email ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.delete_email"
  end
  # resource path
  local_var_path = '/emails/{emailId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#delete_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_attachment(email_id, attachment_id, opts = {}) ⇒ String

Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string. Returns attachment bytes by attachment ID. Use attachment IDs from email payloads or attachment listing endpoints.

Parameters:

  • email_id (String)

    ID of email

  • attachment_id (String)

    ID of attachment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :api_key (String)

    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.

Returns:

  • (String)


596
597
598
599
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 596

def download_attachment(email_id, attachment_id, opts = {})
  data, _status_code, _headers = download_attachment_with_http_info(email_id, attachment_id, opts)
  data
end

#download_attachment_base64(email_id, attachment_id, opts = {}) ⇒ DownloadAttachmentDto

Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`. Returns attachment payload as base64 in JSON. Useful for clients that cannot reliably consume binary streaming responses.

Parameters:

  • email_id (String)

    ID of email

  • attachment_id (String)

    ID of attachment

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



666
667
668
669
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 666

def download_attachment_base64(email_id, attachment_id, opts = {})
  data, _status_code, _headers = download_attachment_base64_with_http_info(email_id, attachment_id, opts)
  data
end

#download_attachment_base64_with_http_info(email_id, attachment_id, opts = {}) ⇒ Array<(DownloadAttachmentDto, Integer, Hash)>

Get email attachment as base64 encoded string as an alternative to binary responses. Decode the &#x60;base64FileContents&#x60; as a &#x60;utf-8&#x60; encoded string or array of bytes depending on the &#x60;contentType&#x60;. Returns attachment payload as base64 in JSON. Useful for clients that cannot reliably consume binary streaming responses.

Parameters:

  • email_id (String)

    ID of email

  • attachment_id (String)

    ID of attachment

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DownloadAttachmentDto, Integer, Hash)>)

    DownloadAttachmentDto data, response status code and response headers



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 677

def download_attachment_base64_with_http_info(email_id, attachment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.download_attachment_base64 ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.download_attachment_base64"
  end
  # verify the required parameter 'attachment_id' is set
  if @api_client.config.client_side_validation && attachment_id.nil?
    fail ArgumentError, "Missing the required parameter 'attachment_id' when calling EmailControllerApi.download_attachment_base64"
  end
  # resource path
  local_var_path = '/emails/{emailId}/attachments/{attachmentId}/base64'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s)).sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'DownloadAttachmentDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#download_attachment_base64\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_attachment_with_http_info(email_id, attachment_id, opts = {}) ⇒ Array<(String, Integer, Hash)>

Get email attachment bytes. Returned as &#x60;octet-stream&#x60; with content type header. If you have trouble with byte responses try the &#x60;downloadAttachmentBase64&#x60; response endpoints and convert the base 64 encoded content to a file or string. Returns attachment bytes by attachment ID. Use attachment IDs from email payloads or attachment listing endpoints.

Parameters:

  • email_id (String)

    ID of email

  • attachment_id (String)

    ID of attachment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :api_key (String)

    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.

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 608

def download_attachment_with_http_info(email_id, attachment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.download_attachment ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.download_attachment"
  end
  # verify the required parameter 'attachment_id' is set
  if @api_client.config.client_side_validation && attachment_id.nil?
    fail ArgumentError, "Missing the required parameter 'attachment_id' when calling EmailControllerApi.download_attachment"
  end
  # resource path
  local_var_path = '/emails/{emailId}/attachments/{attachmentId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s)).sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'apiKey'] = opts[:'api_key'] if !opts[:'api_key'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'String' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#download_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_body(email_id, opts = {}) ⇒ String

Get email body as string. Returned as `plain/text` with content type header. Returns hydrated email body text as a string with content type aligned to the underlying body format.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


733
734
735
736
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 733

def download_body(email_id, opts = {})
  data, _status_code, _headers = download_body_with_http_info(email_id, opts)
  data
end

#download_body_bytes(email_id, opts = {}) ⇒ String

Get email body in bytes. Returned as `octet-stream` with content type header. Streams hydrated email body bytes with content type derived from the message body format.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


795
796
797
798
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 795

def download_body_bytes(email_id, opts = {})
  data, _status_code, _headers = download_body_bytes_with_http_info(email_id, opts)
  data
end

#download_body_bytes_with_http_info(email_id, opts = {}) ⇒ Array<(String, Integer, Hash)>

Get email body in bytes. Returned as &#x60;octet-stream&#x60; with content type header. Streams hydrated email body bytes with content type derived from the message body format.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 805

def download_body_bytes_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.download_body_bytes ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.download_body_bytes"
  end
  # resource path
  local_var_path = '/emails/{emailId}/body-bytes'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'String' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#download_body_bytes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_body_with_http_info(email_id, opts = {}) ⇒ Array<(String, Integer, Hash)>

Get email body as string. Returned as &#x60;plain/text&#x60; with content type header. Returns hydrated email body text as a string with content type aligned to the underlying body format.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 743

def download_body_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.download_body ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.download_body"
  end
  # resource path
  local_var_path = '/emails/{emailId}/body'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'text/html'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'String' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#download_body\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#forward_email(email_id, forward_email_options, opts = {}) ⇒ SentEmailDto

Forward email to recipients Forwards an existing email to new recipients. Uses the owning inbox context unless overridden by allowed sender options.

Parameters:

  • email_id (String)

    ID of email

  • forward_email_options (ForwardEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



858
859
860
861
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 858

def forward_email(email_id, forward_email_options, opts = {})
  data, _status_code, _headers = forward_email_with_http_info(email_id, forward_email_options, opts)
  data
end

#forward_email_with_http_info(email_id, forward_email_options, opts = {}) ⇒ Array<(SentEmailDto, Integer, Hash)>

Forward email to recipients Forwards an existing email to new recipients. Uses the owning inbox context unless overridden by allowed sender options.

Parameters:

  • email_id (String)

    ID of email

  • forward_email_options (ForwardEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SentEmailDto, Integer, Hash)>)

    SentEmailDto data, response status code and response headers



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 869

def forward_email_with_http_info(email_id, forward_email_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.forward_email ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.forward_email"
  end
  # verify the required parameter 'forward_email_options' is set
  if @api_client.config.client_side_validation && forward_email_options.nil?
    fail ArgumentError, "Missing the required parameter 'forward_email_options' when calling EmailControllerApi.forward_email"
  end
  # resource path
  local_var_path = '/emails/{emailId}/forward'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(forward_email_options) 

  # return_type
  return_type = opts[:return_type] || 'SentEmailDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#forward_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_attachment_meta_data(email_id, attachment_id, opts = {}) ⇒ AttachmentMetaData

Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods. Returns metadata for a specific attachment ID (name, content type, and size fields).

Parameters:

  • email_id (String)

    ID of email

  • attachment_id (String)

    ID of attachment

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



928
929
930
931
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 928

def (email_id, attachment_id, opts = {})
  data, _status_code, _headers = (email_id, attachment_id, opts)
  data
end

#get_attachment_meta_data_with_http_info(email_id, attachment_id, opts = {}) ⇒ Array<(AttachmentMetaData, Integer, Hash)>

Get email attachment metadata. This is the &#x60;contentType&#x60; and &#x60;contentLength&#x60; of an attachment. To get the individual attachments use the &#x60;downloadAttachment&#x60; methods. Returns metadata for a specific attachment ID (name, content type, and size fields).

Parameters:

  • email_id (String)

    ID of email

  • attachment_id (String)

    ID of attachment

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AttachmentMetaData, Integer, Hash)>)

    AttachmentMetaData data, response status code and response headers



939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 939

def (email_id, attachment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_attachment_meta_data ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_attachment_meta_data"
  end
  # verify the required parameter 'attachment_id' is set
  if @api_client.config.client_side_validation && attachment_id.nil?
    fail ArgumentError, "Missing the required parameter 'attachment_id' when calling EmailControllerApi.get_attachment_meta_data"
  end
  # resource path
  local_var_path = '/emails/{emailId}/attachments/{attachmentId}/metadata'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s)).sub('{' + 'attachmentId' + '}', CGI.escape(attachment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'AttachmentMetaData' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_attachment_meta_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email(email_id, opts = {}) ⇒ Email

Get hydrated email (headers and body) Returns parsed email content including headers and body fields. Accessing hydrated content may mark the email as read depending on read-state rules.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



995
996
997
998
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 995

def get_email(email_id, opts = {})
  data, _status_code, _headers = get_email_with_http_info(email_id, opts)
  data
end

#get_email_attachments(email_id, opts = {}) ⇒ Array<AttachmentMetaData>

List attachment metadata for an email Returns metadata for all attachment IDs associated with the email (name, content type, size, and IDs).

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1057
1058
1059
1060
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1057

def get_email_attachments(email_id, opts = {})
  data, _status_code, _headers = get_email_attachments_with_http_info(email_id, opts)
  data
end

#get_email_attachments_with_http_info(email_id, opts = {}) ⇒ Array<(Array<AttachmentMetaData>, Integer, Hash)>

List attachment metadata for an email Returns metadata for all attachment IDs associated with the email (name, content type, size, and IDs).

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<AttachmentMetaData>, Integer, Hash)>)

    Array<AttachmentMetaData> data, response status code and response headers



1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1067

def get_email_attachments_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_attachments ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_attachments"
  end
  # resource path
  local_var_path = '/emails/{emailId}/attachments'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Array<AttachmentMetaData>' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_codes(email_id, opts = {}) ⇒ ExtractCodesResult

Extract verification codes from an email Extracts one-time passcodes and similar tokens from email content. Supports deterministic extraction now with method/fallback flags (`AUTO`, `PATTERN`, `LLM`, `OCR`, `OCR_THEN_LLM`) for QA and future advanced pipelines.

Parameters:

  • email_id (String)

    ID of email to extract codes from

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



1120
1121
1122
1123
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1120

def get_email_codes(email_id, opts = {})
  data, _status_code, _headers = get_email_codes_with_http_info(email_id, opts)
  data
end

#get_email_codes_with_http_info(email_id, opts = {}) ⇒ Array<(ExtractCodesResult, Integer, Hash)>

Extract verification codes from an email Extracts one-time passcodes and similar tokens from email content. Supports deterministic extraction now with method/fallback flags (&#x60;AUTO&#x60;, &#x60;PATTERN&#x60;, &#x60;LLM&#x60;, &#x60;OCR&#x60;, &#x60;OCR_THEN_LLM&#x60;) for QA and future advanced pipelines.

Parameters:

  • email_id (String)

    ID of email to extract codes from

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(ExtractCodesResult, Integer, Hash)>)

    ExtractCodesResult data, response status code and response headers



1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1131

def get_email_codes_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_codes ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_codes"
  end
  # resource path
  local_var_path = '/emails/{emailId}/codes'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'extract_codes_options']) 

  # return_type
  return_type = opts[:return_type] || 'ExtractCodesResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_content_match(email_id, content_match_options, opts = {}) ⇒ EmailContentMatchResult

Run regex against hydrated email body and return matches Executes a Java regex pattern over hydrated email body text and returns the full match plus capture groups. Pattern syntax follows Java `Pattern` rules.

Parameters:

  • email_id (String)

    ID of email to match against

  • content_match_options (ContentMatchOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1186
1187
1188
1189
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1186

def get_email_content_match(email_id, content_match_options, opts = {})
  data, _status_code, _headers = get_email_content_match_with_http_info(email_id, content_match_options, opts)
  data
end

#get_email_content_match_with_http_info(email_id, content_match_options, opts = {}) ⇒ Array<(EmailContentMatchResult, Integer, Hash)>

Run regex against hydrated email body and return matches Executes a Java regex pattern over hydrated email body text and returns the full match plus capture groups. Pattern syntax follows Java &#x60;Pattern&#x60; rules.

Parameters:

  • email_id (String)

    ID of email to match against

  • content_match_options (ContentMatchOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailContentMatchResult, Integer, Hash)>)

    EmailContentMatchResult data, response status code and response headers



1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1197

def get_email_content_match_with_http_info(email_id, content_match_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_content_match ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_content_match"
  end
  # verify the required parameter 'content_match_options' is set
  if @api_client.config.client_side_validation && content_match_options.nil?
    fail ArgumentError, "Missing the required parameter 'content_match_options' when calling EmailControllerApi.get_email_content_match"
  end
  # resource path
  local_var_path = '/emails/{emailId}/contentMatch'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(content_match_options) 

  # return_type
  return_type = opts[:return_type] || 'EmailContentMatchResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_content_match\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_content_part(email_id, content_type, opts = {}) ⇒ EmailContentPartResult

Get email content part by content type Extracts one MIME body part by `contentType` and optional `index`, returned in a structured DTO with metadata.

Parameters:

  • email_id (String)

    ID of email to match against

  • content_type (String)

    Content type

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :strict (Boolean)

    Strict content type match

  • :index (Integer)

    Index of content type part if multiple

Returns:



1258
1259
1260
1261
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1258

def get_email_content_part(email_id, content_type, opts = {})
  data, _status_code, _headers = get_email_content_part_with_http_info(email_id, content_type, opts)
  data
end

#get_email_content_part_content(email_id, content_type, opts = {}) ⇒ String

Get multipart content part as raw response Extracts one MIME body part by `contentType` and optional `index`, and returns raw content with matching response content type when valid.

Parameters:

  • email_id (String)

    ID of email to match against

  • content_type (String)

    Content type

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :strict (Boolean)

    Strict content type match

  • :index (Integer)

    Index of content type part if multiple. Starts from 0 and applies to the result list after selecting for your content type. Content type parts are sorted by order found in original MIME message.

Returns:

  • (String)


1333
1334
1335
1336
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1333

def get_email_content_part_content(email_id, content_type, opts = {})
  data, _status_code, _headers = get_email_content_part_content_with_http_info(email_id, content_type, opts)
  data
end

#get_email_content_part_content_with_http_info(email_id, content_type, opts = {}) ⇒ Array<(String, Integer, Hash)>

Get multipart content part as raw response Extracts one MIME body part by &#x60;contentType&#x60; and optional &#x60;index&#x60;, and returns raw content with matching response content type when valid.

Parameters:

  • email_id (String)

    ID of email to match against

  • content_type (String)

    Content type

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :strict (Boolean)

    Strict content type match

  • :index (Integer)

    Index of content type part if multiple. Starts from 0 and applies to the result list after selecting for your content type. Content type parts are sorted by order found in original MIME message.

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1346

def get_email_content_part_content_with_http_info(email_id, content_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_content_part_content ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_content_part_content"
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling EmailControllerApi.get_email_content_part_content"
  end
  # resource path
  local_var_path = '/emails/{emailId}/contentPart/raw'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'contentType'] = content_type
  query_params[:'strict'] = opts[:'strict'] if !opts[:'strict'].nil?
  query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'String' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_content_part_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_content_part_with_http_info(email_id, content_type, opts = {}) ⇒ Array<(EmailContentPartResult, Integer, Hash)>

Get email content part by content type Extracts one MIME body part by &#x60;contentType&#x60; and optional &#x60;index&#x60;, returned in a structured DTO with metadata.

Parameters:

  • email_id (String)

    ID of email to match against

  • content_type (String)

    Content type

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :strict (Boolean)

    Strict content type match

  • :index (Integer)

    Index of content type part if multiple

Returns:

  • (Array<(EmailContentPartResult, Integer, Hash)>)

    EmailContentPartResult data, response status code and response headers



1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1271

def get_email_content_part_with_http_info(email_id, content_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_content_part ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_content_part"
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling EmailControllerApi.get_email_content_part"
  end
  # resource path
  local_var_path = '/emails/{emailId}/contentPart'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'contentType'] = content_type
  query_params[:'strict'] = opts[:'strict'] if !opts[:'strict'].nil?
  query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8', 'application/xml;charset=UTF-8', 'application/json; charset=UTF-8', 'application/xml; charset=UTF-8'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailContentPartResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_content_part\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_count(opts = {}) ⇒ CountDto

Get email count Returns total email count for the authenticated user, or count scoped to a specific inbox when `inboxId` is provided.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

Returns:



1405
1406
1407
1408
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1405

def get_email_count(opts = {})
  data, _status_code, _headers = get_email_count_with_http_info(opts)
  data
end

#get_email_count_with_http_info(opts = {}) ⇒ Array<(CountDto, Integer, Hash)>

Get email count Returns total email count for the authenticated user, or count scoped to a specific inbox when &#x60;inboxId&#x60; is provided.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

Returns:

  • (Array<(CountDto, Integer, Hash)>)

    CountDto data, response status code and response headers



1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1415

def get_email_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_count ...'
  end
  # resource path
  local_var_path = '/emails/emails/count'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'CountDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_html(email_id, opts = {}) ⇒ String

Get hydrated email HTML for browser rendering Returns hydrated HTML body directly with `text/html` content type. Supports temporary access/browser usage and optional CID replacement for inline asset rendering.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :replace_cid_images (Boolean) — default: default to false

Returns:

  • (String)


1465
1466
1467
1468
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1465

def get_email_html(email_id, opts = {})
  data, _status_code, _headers = get_email_html_with_http_info(email_id, opts)
  data
end

#get_email_html_json(email_id, opts = {}) ⇒ EmailHtmlDto

Get hydrated email HTML wrapped in JSON Returns hydrated HTML body and subject in a JSON DTO. Useful for API clients that need structured response payloads instead of raw HTML responses.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :replace_cid_images (Boolean) — default: default to false

Returns:



1530
1531
1532
1533
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1530

def get_email_html_json(email_id, opts = {})
  data, _status_code, _headers = get_email_html_json_with_http_info(email_id, opts)
  data
end

#get_email_html_json_with_http_info(email_id, opts = {}) ⇒ Array<(EmailHtmlDto, Integer, Hash)>

Get hydrated email HTML wrapped in JSON Returns hydrated HTML body and subject in a JSON DTO. Useful for API clients that need structured response payloads instead of raw HTML responses.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :replace_cid_images (Boolean)

Returns:

  • (Array<(EmailHtmlDto, Integer, Hash)>)

    EmailHtmlDto data, response status code and response headers



1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1541

def get_email_html_json_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_html_json ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_html_json"
  end
  # resource path
  local_var_path = '/emails/{emailId}/html/json'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'replaceCidImages'] = opts[:'replace_cid_images'] if !opts[:'replace_cid_images'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailHtmlDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_html_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_html_query(email_id, html_selector, opts = {}) ⇒ EmailTextLinesResult

Query hydrated HTML body and return matching text lines Applies a JSoup/CSS selector to hydrated HTML email body and returns matching text lines.

Parameters:

  • email_id (String)

    ID of email to perform HTML query on

  • html_selector (String)

    HTML selector to search for. Uses JQuery/JSoup/CSS style selector like &#39;.my-div&#39; to match content. See jsoup.org/apidocs/org/jsoup/select/Selector.html for more information.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1595
1596
1597
1598
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1595

def get_email_html_query(email_id, html_selector, opts = {})
  data, _status_code, _headers = get_email_html_query_with_http_info(email_id, html_selector, opts)
  data
end

#get_email_html_query_with_http_info(email_id, html_selector, opts = {}) ⇒ Array<(EmailTextLinesResult, Integer, Hash)>

Query hydrated HTML body and return matching text lines Applies a JSoup/CSS selector to hydrated HTML email body and returns matching text lines.

Parameters:

  • email_id (String)

    ID of email to perform HTML query on

  • html_selector (String)

    HTML selector to search for. Uses JQuery/JSoup/CSS style selector like &#39;.my-div&#39; to match content. See jsoup.org/apidocs/org/jsoup/select/Selector.html for more information.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailTextLinesResult, Integer, Hash)>)

    EmailTextLinesResult data, response status code and response headers



1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1606

def get_email_html_query_with_http_info(email_id, html_selector, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_html_query ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_html_query"
  end
  # verify the required parameter 'html_selector' is set
  if @api_client.config.client_side_validation && html_selector.nil?
    fail ArgumentError, "Missing the required parameter 'html_selector' when calling EmailControllerApi.get_email_html_query"
  end
  # resource path
  local_var_path = '/emails/{emailId}/htmlQuery'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'htmlSelector'] = html_selector

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailTextLinesResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_html_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_html_with_http_info(email_id, opts = {}) ⇒ Array<(String, Integer, Hash)>

Get hydrated email HTML for browser rendering Returns hydrated HTML body directly with &#x60;text/html&#x60; content type. Supports temporary access/browser usage and optional CID replacement for inline asset rendering.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :replace_cid_images (Boolean)

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1476

def get_email_html_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_html ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_html"
  end
  # resource path
  local_var_path = '/emails/{emailId}/html'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'replaceCidImages'] = opts[:'replace_cid_images'] if !opts[:'replace_cid_images'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/html;charset=utf-8', 'text/html'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'String' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Extract links from an email HTML body Parses HTML content and extracts link URLs (`href`). For non-HTML emails this endpoint returns a validation error.

Parameters:

  • email_id (String)

    ID of email to fetch text for

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :selector (String)

    Optional HTML query selector for links

Returns:



1664
1665
1666
1667
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1664

def get_email_links(email_id, opts = {})
  data, _status_code, _headers = get_email_links_with_http_info(email_id, opts)
  data
end

Extract links from an email HTML body Parses HTML content and extracts link URLs (&#x60;href&#x60;). For non-HTML emails this endpoint returns a validation error.

Parameters:

  • email_id (String)

    ID of email to fetch text for

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :selector (String)

    Optional HTML query selector for links

Returns:

  • (Array<(EmailLinksResult, Integer, Hash)>)

    EmailLinksResult data, response status code and response headers



1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1675

def get_email_links_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_links ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_links"
  end
  # resource path
  local_var_path = '/emails/{emailId}/links'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'selector'] = opts[:'selector'] if !opts[:'selector'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailLinksResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_preview_ur_ls(email_id, opts = {}) ⇒ EmailPreviewUrls

Get email URLs for viewing in browser or downloading Returns precomputed URLs for preview and raw message access for the specified email.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1728
1729
1730
1731
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1728

def get_email_preview_ur_ls(email_id, opts = {})
  data, _status_code, _headers = get_email_preview_ur_ls_with_http_info(email_id, opts)
  data
end

#get_email_preview_ur_ls_with_http_info(email_id, opts = {}) ⇒ Array<(EmailPreviewUrls, Integer, Hash)>

Get email URLs for viewing in browser or downloading Returns precomputed URLs for preview and raw message access for the specified email.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailPreviewUrls, Integer, Hash)>)

    EmailPreviewUrls data, response status code and response headers



1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1738

def get_email_preview_ur_ls_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_preview_ur_ls ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_preview_ur_ls"
  end
  # resource path
  local_var_path = '/emails/{emailId}/urls'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailPreviewUrls' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_preview_ur_ls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_screenshot_as_base64(email_id, get_email_screenshot_options, opts = {}) ⇒ EmailScreenshotResult

Take a screenshot of an email in a browser and return base64 encoded string Renders the email in a browser engine and returns PNG data as base64. Useful for APIs and dashboards that cannot easily stream binary responses.

Parameters:

  • email_id (String)
  • get_email_screenshot_options (GetEmailScreenshotOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1791
1792
1793
1794
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1791

def get_email_screenshot_as_base64(email_id, get_email_screenshot_options, opts = {})
  data, _status_code, _headers = get_email_screenshot_as_base64_with_http_info(email_id, get_email_screenshot_options, opts)
  data
end

#get_email_screenshot_as_base64_with_http_info(email_id, get_email_screenshot_options, opts = {}) ⇒ Array<(EmailScreenshotResult, Integer, Hash)>

Take a screenshot of an email in a browser and return base64 encoded string Renders the email in a browser engine and returns PNG data as base64. Useful for APIs and dashboards that cannot easily stream binary responses.

Parameters:

  • email_id (String)
  • get_email_screenshot_options (GetEmailScreenshotOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailScreenshotResult, Integer, Hash)>)

    EmailScreenshotResult data, response status code and response headers



1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1802

def get_email_screenshot_as_base64_with_http_info(email_id, get_email_screenshot_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_screenshot_as_base64 ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_screenshot_as_base64"
  end
  # verify the required parameter 'get_email_screenshot_options' is set
  if @api_client.config.client_side_validation && get_email_screenshot_options.nil?
    fail ArgumentError, "Missing the required parameter 'get_email_screenshot_options' when calling EmailControllerApi.get_email_screenshot_as_base64"
  end
  # resource path
  local_var_path = '/emails/{emailId}/screenshot/base64'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(get_email_screenshot_options) 

  # return_type
  return_type = opts[:return_type] || 'EmailScreenshotResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_screenshot_as_base64\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_screenshot_as_binary(email_id, get_email_screenshot_options, opts = {}) ⇒ nil

Take a screenshot of an email in a browser Renders the email in a browser engine and returns PNG bytes. Intended for visual QA and rendering regression checks.

Parameters:

  • email_id (String)
  • get_email_screenshot_options (GetEmailScreenshotOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1861
1862
1863
1864
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1861

def get_email_screenshot_as_binary(email_id, get_email_screenshot_options, opts = {})
  get_email_screenshot_as_binary_with_http_info(email_id, get_email_screenshot_options, opts)
  nil
end

#get_email_screenshot_as_binary_with_http_info(email_id, get_email_screenshot_options, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Take a screenshot of an email in a browser Renders the email in a browser engine and returns PNG bytes. Intended for visual QA and rendering regression checks.

Parameters:

  • email_id (String)
  • get_email_screenshot_options (GetEmailScreenshotOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1872

def get_email_screenshot_as_binary_with_http_info(email_id, get_email_screenshot_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_screenshot_as_binary ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_screenshot_as_binary"
  end
  # verify the required parameter 'get_email_screenshot_options' is set
  if @api_client.config.client_side_validation && get_email_screenshot_options.nil?
    fail ArgumentError, "Missing the required parameter 'get_email_screenshot_options' when calling EmailControllerApi.get_email_screenshot_as_binary"
  end
  # resource path
  local_var_path = '/emails/{emailId}/screenshot/binary'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(get_email_screenshot_options) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_screenshot_as_binary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_signature(email_id, opts = {}) ⇒ EmailSignatureParseResult

Extract signature from an inbound email Attempts to parse a sender signature block from an email body. Uses raw MIME content parts when possible and falls back to hydrated body parsing. This is heuristic and may not be accurate for all email clients or formats.

Parameters:

  • email_id (String)

    ID of email to extract signature from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1928
1929
1930
1931
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1928

def get_email_signature(email_id, opts = {})
  data, _status_code, _headers = get_email_signature_with_http_info(email_id, opts)
  data
end

#get_email_signature_with_http_info(email_id, opts = {}) ⇒ Array<(EmailSignatureParseResult, Integer, Hash)>

Extract signature from an inbound email Attempts to parse a sender signature block from an email body. Uses raw MIME content parts when possible and falls back to hydrated body parsing. This is heuristic and may not be accurate for all email clients or formats.

Parameters:

  • email_id (String)

    ID of email to extract signature from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailSignatureParseResult, Integer, Hash)>)

    EmailSignatureParseResult data, response status code and response headers



1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1938

def get_email_signature_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_signature ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_signature"
  end
  # resource path
  local_var_path = '/emails/{emailId}/signature'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailSignatureParseResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_signature\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_summary(email_id, opts = {}) ⇒ EmailPreview

Get email summary (headers/metadata only) Returns lightweight metadata and headers for an email. Use `getEmail` for hydrated body content or `getRawEmail` for original SMTP content.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :decode (Boolean)

    Deprecated and ignored. Retained for backwards compatibility.

Returns:



1991
1992
1993
1994
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1991

def get_email_summary(email_id, opts = {})
  data, _status_code, _headers = get_email_summary_with_http_info(email_id, opts)
  data
end

#get_email_summary_with_http_info(email_id, opts = {}) ⇒ Array<(EmailPreview, Integer, Hash)>

Get email summary (headers/metadata only) Returns lightweight metadata and headers for an email. Use &#x60;getEmail&#x60; for hydrated body content or &#x60;getRawEmail&#x60; for original SMTP content.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :decode (Boolean)

    Deprecated and ignored. Retained for backwards compatibility.

Returns:

  • (Array<(EmailPreview, Integer, Hash)>)

    EmailPreview data, response status code and response headers



2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2002

def get_email_summary_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_summary ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_summary"
  end
  # resource path
  local_var_path = '/emails/{emailId}/summary'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'decode'] = opts[:'decode'] if !opts[:'decode'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailPreview' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_text_lines(email_id, opts = {}) ⇒ EmailTextLinesResult

Extract normalized text lines from email body Converts email body content to line-based plain text with optional HTML entity decoding and custom line separator.

Parameters:

  • email_id (String)

    ID of email to fetch text for

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :decode_html_entities (Boolean)

    Decode HTML entities

  • :line_separator (String)

    Line separator character

Returns:



2057
2058
2059
2060
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2057

def get_email_text_lines(email_id, opts = {})
  data, _status_code, _headers = get_email_text_lines_with_http_info(email_id, opts)
  data
end

#get_email_text_lines_with_http_info(email_id, opts = {}) ⇒ Array<(EmailTextLinesResult, Integer, Hash)>

Extract normalized text lines from email body Converts email body content to line-based plain text with optional HTML entity decoding and custom line separator.

Parameters:

  • email_id (String)

    ID of email to fetch text for

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :decode_html_entities (Boolean)

    Decode HTML entities

  • :line_separator (String)

    Line separator character

Returns:

  • (Array<(EmailTextLinesResult, Integer, Hash)>)

    EmailTextLinesResult data, response status code and response headers



2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2069

def get_email_text_lines_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_text_lines ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_text_lines"
  end
  # resource path
  local_var_path = '/emails/{emailId}/textLines'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'decodeHtmlEntities'] = opts[:'decode_html_entities'] if !opts[:'decode_html_entities'].nil?
  query_params[:'lineSeparator'] = opts[:'line_separator'] if !opts[:'line_separator'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailTextLinesResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_text_lines\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_thread(thread_id, opts = {}) ⇒ EmailThreadDto

Get email thread metadata by thread ID Returns thread metadata built from RFC 5322 `Message-ID`, `In-Reply-To`, and `References` headers. Use `getEmailThreadItems` to fetch the thread messages.

Parameters:

  • thread_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2123
2124
2125
2126
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2123

def get_email_thread(thread_id, opts = {})
  data, _status_code, _headers = get_email_thread_with_http_info(thread_id, opts)
  data
end

#get_email_thread_items(thread_id, opts = {}) ⇒ EmailThreadItemsDto

Get messages in a specific email thread Returns all messages in a thread ordered by `createdAt` using the requested sort direction.

Parameters:

  • thread_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

Returns:



2186
2187
2188
2189
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2186

def get_email_thread_items(thread_id, opts = {})
  data, _status_code, _headers = get_email_thread_items_with_http_info(thread_id, opts)
  data
end

#get_email_thread_items_with_http_info(thread_id, opts = {}) ⇒ Array<(EmailThreadItemsDto, Integer, Hash)>

Get messages in a specific email thread Returns all messages in a thread ordered by &#x60;createdAt&#x60; using the requested sort direction.

Parameters:

  • thread_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

Returns:

  • (Array<(EmailThreadItemsDto, Integer, Hash)>)

    EmailThreadItemsDto data, response status code and response headers



2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2197

def get_email_thread_items_with_http_info(thread_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_thread_items ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling EmailControllerApi.get_email_thread_items"
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/emails/threads/{threadId}/items'.sub('{' + 'threadId' + '}', CGI.escape(thread_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailThreadItemsDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_thread_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_thread_with_http_info(thread_id, opts = {}) ⇒ Array<(EmailThreadDto, Integer, Hash)>

Get email thread metadata by thread ID Returns thread metadata built from RFC 5322 &#x60;Message-ID&#x60;, &#x60;In-Reply-To&#x60;, and &#x60;References&#x60; headers. Use &#x60;getEmailThreadItems&#x60; to fetch the thread messages.

Parameters:

  • thread_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EmailThreadDto, Integer, Hash)>)

    EmailThreadDto data, response status code and response headers



2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2133

def get_email_thread_with_http_info(thread_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_thread ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling EmailControllerApi.get_email_thread"
  end
  # resource path
  local_var_path = '/emails/threads/{threadId}'.sub('{' + 'threadId' + '}', CGI.escape(thread_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailThreadDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_thread\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_threads(opts = {}) ⇒ PageEmailThreadProjection

List email threads in paginated form Lists conversation threads inferred from `Message-ID`, `In-Reply-To`, and `References`. Supports filtering by inbox, search text, and time range.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :html_selector (String)

    Optional inbox filter. Query parameter name is &#x60;htmlSelector&#x60; for legacy compatibility.

  • :page (Integer)

    Optional page index in email thread pagination (default to 0)

  • :size (Integer)

    Optional page size in email thread pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :search_filter (String)

    Optional search filter search filter for email threads.

  • :since (DateTime)

    Optional filter email threads created since time

  • :before (DateTime)

    Optional filter emails threads created before given date time

Returns:



2260
2261
2262
2263
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2260

def get_email_threads(opts = {})
  data, _status_code, _headers = get_email_threads_with_http_info(opts)
  data
end

#get_email_threads_with_http_info(opts = {}) ⇒ Array<(PageEmailThreadProjection, Integer, Hash)>

List email threads in paginated form Lists conversation threads inferred from &#x60;Message-ID&#x60;, &#x60;In-Reply-To&#x60;, and &#x60;References&#x60;. Supports filtering by inbox, search text, and time range.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :html_selector (String)

    Optional inbox filter. Query parameter name is &#x60;htmlSelector&#x60; for legacy compatibility.

  • :page (Integer)

    Optional page index in email thread pagination

  • :size (Integer)

    Optional page size in email thread pagination. Maximum size is 100. Use page index and sort to page through larger results

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter search filter for email threads.

  • :since (DateTime)

    Optional filter email threads created since time

  • :before (DateTime)

    Optional filter emails threads created before given date time

Returns:

  • (Array<(PageEmailThreadProjection, Integer, Hash)>)

    PageEmailThreadProjection data, response status code and response headers



2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2276

def get_email_threads_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_threads ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling EmailControllerApi.get_email_threads, must be smaller than or equal to 100.'
  end

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/emails/threads'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'htmlSelector'] = opts[:'html_selector'] if !opts[:'html_selector'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageEmailThreadProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_email_with_http_info(email_id, opts = {}) ⇒ Array<(Email, Integer, Hash)>

Get hydrated email (headers and body) Returns parsed email content including headers and body fields. Accessing hydrated content may mark the email as read depending on read-state rules.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Email, Integer, Hash)>)

    Email data, response status code and response headers



1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 1005

def get_email_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email"
  end
  # resource path
  local_var_path = '/emails/{emailId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8', 'application/xml;charset=UTF-8', 'application/json; charset=UTF-8', 'application/xml; charset=UTF-8'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Email' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_emails_offset_paginated(opts = {}) ⇒ PageEmailProjection

Get all emails in all inboxes in paginated form. Email API list all. Offset-style pagination endpoint for listing emails across inboxes. Supports inbox filters, unread-only, search, date boundaries, favourites, connector sync, plus-address filtering, and explicit include IDs.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (Array<String>)

    Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.

  • :page (Integer)

    Optional page index in email list pagination (default to 0)

  • :size (Integer)

    Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :unread_only (Boolean)

    Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (default to false)

  • :search_filter (String)

    Optional search filter. Full email addresses match sender and receiving inbox email or receiving plus-address full address exactly. Address-like fragments containing @ (for example +alias@) also match sender, receiving inbox email, and receiving plus-address full address by contains. General text search matches sender, subject, and ID.

  • :since (DateTime)

    Optional filter emails received after given date time

  • :before (DateTime)

    Optional filter emails received before given date time

  • :favourited (Boolean)

    Optional filter emails that are favourited

  • :sync_connectors (Boolean)

    Sync connectors

  • :plus_address_id (String)

    Optional plus address ID filter

  • :include (Array<String>)

    Optional list of IDs to include in result

Returns:



2350
2351
2352
2353
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2350

def get_emails_offset_paginated(opts = {})
  data, _status_code, _headers = get_emails_offset_paginated_with_http_info(opts)
  data
end

#get_emails_offset_paginated_with_http_info(opts = {}) ⇒ Array<(PageEmailProjection, Integer, Hash)>

Get all emails in all inboxes in paginated form. Email API list all. Offset-style pagination endpoint for listing emails across inboxes. Supports inbox filters, unread-only, search, date boundaries, favourites, connector sync, plus-address filtering, and explicit include IDs.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (Array<String>)

    Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.

  • :page (Integer)

    Optional page index in email list pagination

  • :size (Integer)

    Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :unread_only (Boolean)

    Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly

  • :search_filter (String)

    Optional search filter. Full email addresses match sender and receiving inbox email or receiving plus-address full address exactly. Address-like fragments containing @ (for example +alias@) also match sender, receiving inbox email, and receiving plus-address full address by contains. General text search matches sender, subject, and ID.

  • :since (DateTime)

    Optional filter emails received after given date time

  • :before (DateTime)

    Optional filter emails received before given date time

  • :favourited (Boolean)

    Optional filter emails that are favourited

  • :sync_connectors (Boolean)

    Sync connectors

  • :plus_address_id (String)

    Optional plus address ID filter

  • :include (Array<String>)

    Optional list of IDs to include in result

Returns:

  • (Array<(PageEmailProjection, Integer, Hash)>)

    PageEmailProjection data, response status code and response headers



2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2371

def get_emails_offset_paginated_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_emails_offset_paginated ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling EmailControllerApi.get_emails_offset_paginated, must be smaller than or equal to 100.'
  end

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/emails/offset-paginated'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = @api_client.build_collection_param(opts[:'inbox_id'], :multi) if !opts[:'inbox_id'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'favourited'] = opts[:'favourited'] if !opts[:'favourited'].nil?
  query_params[:'syncConnectors'] = opts[:'sync_connectors'] if !opts[:'sync_connectors'].nil?
  query_params[:'plusAddressId'] = opts[:'plus_address_id'] if !opts[:'plus_address_id'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageEmailProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_emails_offset_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_emails_paginated(opts = {}) ⇒ PageEmailProjection

Get all emails in all inboxes in paginated form. Email API list all. Primary paginated email listing endpoint. Returns emails across inboxes with support for inbox filters, unread-only, search, date boundaries, favourites, connector sync, and plus-address filtering.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (Array<String>)

    Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.

  • :page (Integer)

    Optional page index in email list pagination (default to 0)

  • :size (Integer)

    Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :unread_only (Boolean)

    Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (default to false)

  • :search_filter (String)

    Optional search filter. Full email addresses match sender and receiving inbox email or receiving plus-address full address exactly. Address-like fragments containing @ (for example +alias@) also match sender, receiving inbox email, and receiving plus-address full address by contains. General text search matches sender, subject, and ID.

  • :since (DateTime)

    Optional filter emails received after given date time. If unset will use time 24hours prior to now.

  • :before (DateTime)

    Optional filter emails received before given date time

  • :sync_connectors (Boolean)

    Sync connectors

  • :plus_address_id (String)

    Optional plus address ID filter

  • :favourited (Boolean)

    Optional filter emails that are favourited

Returns:



2449
2450
2451
2452
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2449

def get_emails_paginated(opts = {})
  data, _status_code, _headers = get_emails_paginated_with_http_info(opts)
  data
end

#get_emails_paginated_with_http_info(opts = {}) ⇒ Array<(PageEmailProjection, Integer, Hash)>

Get all emails in all inboxes in paginated form. Email API list all. Primary paginated email listing endpoint. Returns emails across inboxes with support for inbox filters, unread-only, search, date boundaries, favourites, connector sync, and plus-address filtering.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (Array<String>)

    Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.

  • :page (Integer)

    Optional page index in email list pagination

  • :size (Integer)

    Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :unread_only (Boolean)

    Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly

  • :search_filter (String)

    Optional search filter. Full email addresses match sender and receiving inbox email or receiving plus-address full address exactly. Address-like fragments containing @ (for example +alias@) also match sender, receiving inbox email, and receiving plus-address full address by contains. General text search matches sender, subject, and ID.

  • :since (DateTime)

    Optional filter emails received after given date time. If unset will use time 24hours prior to now.

  • :before (DateTime)

    Optional filter emails received before given date time

  • :sync_connectors (Boolean)

    Sync connectors

  • :plus_address_id (String)

    Optional plus address ID filter

  • :favourited (Boolean)

    Optional filter emails that are favourited

Returns:

  • (Array<(PageEmailProjection, Integer, Hash)>)

    PageEmailProjection data, response status code and response headers



2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2469

def get_emails_paginated_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_emails_paginated ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling EmailControllerApi.get_emails_paginated, must be smaller than or equal to 100.'
  end

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/emails'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = @api_client.build_collection_param(opts[:'inbox_id'], :multi) if !opts[:'inbox_id'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'syncConnectors'] = opts[:'sync_connectors'] if !opts[:'sync_connectors'].nil?
  query_params[:'plusAddressId'] = opts[:'plus_address_id'] if !opts[:'plus_address_id'].nil?
  query_params[:'favourited'] = opts[:'favourited'] if !opts[:'favourited'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageEmailProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_emails_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_gravatar_url_for_email_address(email_address, opts = {}) ⇒ GravatarUrl

Get Gravatar URL for an email address Builds a Gravatar image URL from the provided email address and optional size. This endpoint does not fetch image bytes; it only returns the computed URL.

Parameters:

  • email_address (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :size (String)

Returns:



2537
2538
2539
2540
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2537

def get_gravatar_url_for_email_address(email_address, opts = {})
  data, _status_code, _headers = get_gravatar_url_for_email_address_with_http_info(email_address, opts)
  data
end

#get_gravatar_url_for_email_address_with_http_info(email_address, opts = {}) ⇒ Array<(GravatarUrl, Integer, Hash)>

Get Gravatar URL for an email address Builds a Gravatar image URL from the provided email address and optional size. This endpoint does not fetch image bytes; it only returns the computed URL.

Parameters:

  • email_address (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :size (String)

Returns:

  • (Array<(GravatarUrl, Integer, Hash)>)

    GravatarUrl data, response status code and response headers



2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2548

def get_gravatar_url_for_email_address_with_http_info(email_address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_gravatar_url_for_email_address ...'
  end
  # verify the required parameter 'email_address' is set
  if @api_client.config.client_side_validation && email_address.nil?
    fail ArgumentError, "Missing the required parameter 'email_address' when calling EmailControllerApi.get_gravatar_url_for_email_address"
  end
  # resource path
  local_var_path = '/emails/gravatarFor'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'emailAddress'] = email_address
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'GravatarUrl' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_gravatar_url_for_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_latest_email(opts = {}) ⇒ Email

Get latest email in all inboxes. Most recently received. Returns the most recently received email across all inboxes or an optional subset of inbox IDs.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_ids (Array<String>)

    Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes

Returns:



2602
2603
2604
2605
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2602

def get_latest_email(opts = {})
  data, _status_code, _headers = get_latest_email_with_http_info(opts)
  data
end

#get_latest_email_in_inbox1(inbox_id, opts = {}) ⇒ Email

Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. Returns the newest email for the specified inbox ID. For polling/wait semantics use wait endpoints.

Parameters:

  • inbox_id (String)

    ID of the inbox you want to get the latest email from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2661
2662
2663
2664
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2661

def get_latest_email_in_inbox1(inbox_id, opts = {})
  data, _status_code, _headers = get_latest_email_in_inbox1_with_http_info(inbox_id, opts)
  data
end

#get_latest_email_in_inbox1_with_http_info(inbox_id, opts = {}) ⇒ Array<(Email, Integer, Hash)>

Get latest email in an inbox. Use &#x60;WaitForController&#x60; to get emails that may not have arrived yet. Returns the newest email for the specified inbox ID. For polling/wait semantics use wait endpoints.

Parameters:

  • inbox_id (String)

    ID of the inbox you want to get the latest email from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Email, Integer, Hash)>)

    Email data, response status code and response headers



2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2671

def get_latest_email_in_inbox1_with_http_info(inbox_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_latest_email_in_inbox1 ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling EmailControllerApi.get_latest_email_in_inbox1"
  end
  # resource path
  local_var_path = '/emails/latestIn'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = inbox_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Email' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_latest_email_in_inbox1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_latest_email_with_http_info(opts = {}) ⇒ Array<(Email, Integer, Hash)>

Get latest email in all inboxes. Most recently received. Returns the most recently received email across all inboxes or an optional subset of inbox IDs.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_ids (Array<String>)

    Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes

Returns:

  • (Array<(Email, Integer, Hash)>)

    Email data, response status code and response headers



2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2612

def get_latest_email_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_latest_email ...'
  end
  # resource path
  local_var_path = '/emails/latest'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxIds'] = @api_client.build_collection_param(opts[:'inbox_ids'], :multi) if !opts[:'inbox_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Email' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_latest_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_organization_emails_paginated(opts = {}) ⇒ PageEmailProjection

List organization-visible emails Returns paginated emails visible through organization/team access. Supports inbox filtering, unread-only filtering, search, favourites, plus-address filtering, and optional connector sync.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (Array<String>)

    Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.

  • :page (Integer)

    Optional page index in email list pagination (default to 0)

  • :size (Integer)

    Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :unread_only (Boolean)

    Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (default to false)

  • :search_filter (String)

    Optional search filter search filter for emails.

  • :since (DateTime)

    Optional filter emails received after given date time. If unset will use time 24hours prior to now.

  • :before (DateTime)

    Optional filter emails received before given date time

  • :sync_connectors (Boolean)

    Sync connectors

  • :favourited (Boolean)

    Search only favorited emails

  • :plus_address_id (String)

    Optional plus address ID filter

Returns:



2734
2735
2736
2737
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2734

def get_organization_emails_paginated(opts = {})
  data, _status_code, _headers = get_organization_emails_paginated_with_http_info(opts)
  data
end

#get_organization_emails_paginated_with_http_info(opts = {}) ⇒ Array<(PageEmailProjection, Integer, Hash)>

List organization-visible emails Returns paginated emails visible through organization/team access. Supports inbox filtering, unread-only filtering, search, favourites, plus-address filtering, and optional connector sync.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (Array<String>)

    Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.

  • :page (Integer)

    Optional page index in email list pagination

  • :size (Integer)

    Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :unread_only (Boolean)

    Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly

  • :search_filter (String)

    Optional search filter search filter for emails.

  • :since (DateTime)

    Optional filter emails received after given date time. If unset will use time 24hours prior to now.

  • :before (DateTime)

    Optional filter emails received before given date time

  • :sync_connectors (Boolean)

    Sync connectors

  • :favourited (Boolean)

    Search only favorited emails

  • :plus_address_id (String)

    Optional plus address ID filter

Returns:

  • (Array<(PageEmailProjection, Integer, Hash)>)

    PageEmailProjection data, response status code and response headers



2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2754

def get_organization_emails_paginated_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_organization_emails_paginated ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling EmailControllerApi.get_organization_emails_paginated, must be smaller than or equal to 100.'
  end

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/emails/organization'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = @api_client.build_collection_param(opts[:'inbox_id'], :multi) if !opts[:'inbox_id'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'syncConnectors'] = opts[:'sync_connectors'] if !opts[:'sync_connectors'].nil?
  query_params[:'favourited'] = opts[:'favourited'] if !opts[:'favourited'].nil?
  query_params[:'plusAddressId'] = opts[:'plus_address_id'] if !opts[:'plus_address_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageEmailProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_organization_emails_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_raw_email_contents(email_id, opts = {}) ⇒ nil

Get raw email string. Returns unparsed raw SMTP message with headers and body. Returns the original unparsed SMTP/MIME message as `text/plain`. Use JSON variant if your client expects JSON transport.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


2821
2822
2823
2824
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2821

def get_raw_email_contents(email_id, opts = {})
  get_raw_email_contents_with_http_info(email_id, opts)
  nil
end

#get_raw_email_contents_with_http_info(email_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get raw email string. Returns unparsed raw SMTP message with headers and body. Returns the original unparsed SMTP/MIME message as &#x60;text/plain&#x60;. Use JSON variant if your client expects JSON transport.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2831

def get_raw_email_contents_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_raw_email_contents ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_raw_email_contents"
  end
  # resource path
  local_var_path = '/emails/{emailId}/raw'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_raw_email_contents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_raw_email_json(email_id, opts = {}) ⇒ RawEmailJson

Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. Returns the original unparsed SMTP/MIME message wrapped in a JSON DTO for API clients that avoid plain-text stream responses.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2881
2882
2883
2884
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2881

def get_raw_email_json(email_id, opts = {})
  data, _status_code, _headers = get_raw_email_json_with_http_info(email_id, opts)
  data
end

#get_raw_email_json_with_http_info(email_id, opts = {}) ⇒ Array<(RawEmailJson, Integer, Hash)>

Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. Returns the original unparsed SMTP/MIME message wrapped in a JSON DTO for API clients that avoid plain-text stream responses.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RawEmailJson, Integer, Hash)>)

    RawEmailJson data, response status code and response headers



2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2891

def get_raw_email_json_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_raw_email_json ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_raw_email_json"
  end
  # resource path
  local_var_path = '/emails/{emailId}/raw/json'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'RawEmailJson' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_raw_email_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_unread_email_count(opts = {}) ⇒ UnreadCount

Get unread email count Returns unread email count. An email is considered read after dashboard/API retrieval depending on your read workflow.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID filter for unread count scope

Returns:



2943
2944
2945
2946
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2943

def get_unread_email_count(opts = {})
  data, _status_code, _headers = get_unread_email_count_with_http_info(opts)
  data
end

#get_unread_email_count_with_http_info(opts = {}) ⇒ Array<(UnreadCount, Integer, Hash)>

Get unread email count Returns unread email count. An email is considered read after dashboard/API retrieval depending on your read workflow.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Inbox ID filter for unread count scope

Returns:

  • (Array<(UnreadCount, Integer, Hash)>)

    UnreadCount data, response status code and response headers



2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 2953

def get_unread_email_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.get_unread_email_count ...'
  end
  # resource path
  local_var_path = '/emails/unreadCount'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'UnreadCount' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#get_unread_email_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mark_all_as_read(opts = {}) ⇒ nil

Mark all emails as read or unread Sets read state for all emails, optionally scoped to one inbox. Use `read=false` to reset unread state in bulk.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :read (Boolean)

    What value to assign to email read property. Default true. (default to true)

  • :inbox_id (String)

    Optional inbox ID filter

Returns:

  • (nil)


3003
3004
3005
3006
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3003

def mark_all_as_read(opts = {})
  mark_all_as_read_with_http_info(opts)
  nil
end

#mark_all_as_read_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Mark all emails as read or unread Sets read state for all emails, optionally scoped to one inbox. Use &#x60;read&#x3D;false&#x60; to reset unread state in bulk.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :read (Boolean)

    What value to assign to email read property. Default true.

  • :inbox_id (String)

    Optional inbox ID filter

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3014

def mark_all_as_read_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.mark_all_as_read ...'
  end
  # resource path
  local_var_path = '/emails/read'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'read'] = opts[:'read'] if !opts[:'read'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#mark_all_as_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mark_as_read(email_id, opts = {}) ⇒ EmailPreview

Mark an email as read or unread Sets read state for one email. Useful when implementing custom mailbox workflows that treat viewed messages as unread.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :read (Boolean)

    What value to assign to email read property. Default true. (default to true)

Returns:



3063
3064
3065
3066
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3063

def mark_as_read(email_id, opts = {})
  data, _status_code, _headers = mark_as_read_with_http_info(email_id, opts)
  data
end

#mark_as_read_with_http_info(email_id, opts = {}) ⇒ Array<(EmailPreview, Integer, Hash)>

Mark an email as read or unread Sets read state for one email. Useful when implementing custom mailbox workflows that treat viewed messages as unread.

Parameters:

  • email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :read (Boolean)

    What value to assign to email read property. Default true.

Returns:

  • (Array<(EmailPreview, Integer, Hash)>)

    EmailPreview data, response status code and response headers



3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3074

def mark_as_read_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.mark_as_read ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.mark_as_read"
  end
  # resource path
  local_var_path = '/emails/{emailId}/read'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'read'] = opts[:'read'] if !opts[:'read'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EmailPreview' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#mark_as_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reply_to_email(email_id, reply_to_email_options, opts = {}) ⇒ SentEmailDto

Reply to an email Sends a reply using the original conversation context (subject/thread headers). Reply target resolution honors sender/reply-to semantics.

Parameters:

  • email_id (String)

    ID of the email that should be replied to

  • reply_to_email_options (ReplyToEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3128
3129
3130
3131
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3128

def reply_to_email(email_id, reply_to_email_options, opts = {})
  data, _status_code, _headers = reply_to_email_with_http_info(email_id, reply_to_email_options, opts)
  data
end

#reply_to_email_with_http_info(email_id, reply_to_email_options, opts = {}) ⇒ Array<(SentEmailDto, Integer, Hash)>

Reply to an email Sends a reply using the original conversation context (subject/thread headers). Reply target resolution honors sender/reply-to semantics.

Parameters:

  • email_id (String)

    ID of the email that should be replied to

  • reply_to_email_options (ReplyToEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SentEmailDto, Integer, Hash)>)

    SentEmailDto data, response status code and response headers



3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3139

def reply_to_email_with_http_info(email_id, reply_to_email_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.reply_to_email ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.reply_to_email"
  end
  # verify the required parameter 'reply_to_email_options' is set
  if @api_client.config.client_side_validation && reply_to_email_options.nil?
    fail ArgumentError, "Missing the required parameter 'reply_to_email_options' when calling EmailControllerApi.reply_to_email"
  end
  # resource path
  local_var_path = '/emails/{emailId}'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(reply_to_email_options) 

  # return_type
  return_type = opts[:return_type] || 'SentEmailDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#reply_to_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_emails(search_emails_options, opts = {}) ⇒ PageEmailProjection

Get all emails by search criteria. Return in paginated form. Searches emails by sender/recipient/address/subject/id fields and returns paginated matches. Does not perform full-text body search.

Parameters:

  • search_emails_options (SearchEmailsOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sync_connectors (Boolean)

    Sync connectors

  • :favourited (Boolean)

    Search only favourited emails

  • :plus_address_id (String)

    Optional plus address ID filter

Returns:



3200
3201
3202
3203
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3200

def search_emails(search_emails_options, opts = {})
  data, _status_code, _headers = search_emails_with_http_info(search_emails_options, opts)
  data
end

#search_emails_with_http_info(search_emails_options, opts = {}) ⇒ Array<(PageEmailProjection, Integer, Hash)>

Get all emails by search criteria. Return in paginated form. Searches emails by sender/recipient/address/subject/id fields and returns paginated matches. Does not perform full-text body search.

Parameters:

  • search_emails_options (SearchEmailsOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sync_connectors (Boolean)

    Sync connectors

  • :favourited (Boolean)

    Search only favourited emails

  • :plus_address_id (String)

    Optional plus address ID filter

Returns:

  • (Array<(PageEmailProjection, Integer, Hash)>)

    PageEmailProjection data, response status code and response headers



3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3213

def search_emails_with_http_info(search_emails_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.search_emails ...'
  end
  # verify the required parameter 'search_emails_options' is set
  if @api_client.config.client_side_validation && search_emails_options.nil?
    fail ArgumentError, "Missing the required parameter 'search_emails_options' when calling EmailControllerApi.search_emails"
  end
  # resource path
  local_var_path = '/emails/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'syncConnectors'] = opts[:'sync_connectors'] if !opts[:'sync_connectors'].nil?
  query_params[:'favourited'] = opts[:'favourited'] if !opts[:'favourited'].nil?
  query_params[:'plusAddressId'] = opts[:'plus_address_id'] if !opts[:'plus_address_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(search_emails_options) 

  # return_type
  return_type = opts[:return_type] || 'PageEmailProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#search_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_email_source_optional(send_email_options, opts = {}) ⇒ nil

Send email Sends an email from an existing inbox, or creates a temporary inbox when `inboxId` is not provided. Supports `useDomainPool` and `virtualSend` inbox creation behavior for convenience sends.

Parameters:

  • send_email_options (SendEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    ID of the inbox you want to send the email from

  • :use_domain_pool (Boolean)

    Use domain pool. Optionally create inbox to send from using the mailslurp domain pool.

  • :virtual_send (Boolean)

    Optionally create inbox to send from that is a virtual inbox and won&#39;t send to external addresses

Returns:

  • (nil)


3273
3274
3275
3276
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3273

def send_email_source_optional(send_email_options, opts = {})
  send_email_source_optional_with_http_info(send_email_options, opts)
  nil
end

#send_email_source_optional_with_http_info(send_email_options, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Send email Sends an email from an existing inbox, or creates a temporary inbox when &#x60;inboxId&#x60; is not provided. Supports &#x60;useDomainPool&#x60; and &#x60;virtualSend&#x60; inbox creation behavior for convenience sends.

Parameters:

  • send_email_options (SendEmailOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    ID of the inbox you want to send the email from

  • :use_domain_pool (Boolean)

    Use domain pool. Optionally create inbox to send from using the mailslurp domain pool.

  • :virtual_send (Boolean)

    Optionally create inbox to send from that is a virtual inbox and won&#39;t send to external addresses

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3286

def send_email_source_optional_with_http_info(send_email_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.send_email_source_optional ...'
  end
  # verify the required parameter 'send_email_options' is set
  if @api_client.config.client_side_validation && send_email_options.nil?
    fail ArgumentError, "Missing the required parameter 'send_email_options' when calling EmailControllerApi.send_email_source_optional"
  end
  # resource path
  local_var_path = '/emails'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'useDomainPool'] = opts[:'use_domain_pool'] if !opts[:'use_domain_pool'].nil?
  query_params[:'virtualSend'] = opts[:'virtual_send'] if !opts[:'virtual_send'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(send_email_options) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#send_email_source_optional\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_email_favourited(email_id, favourited, opts = {}) ⇒ nil

Set email favourited state Sets favourite state for an email for dashboard/search workflows.

Parameters:

  • email_id (String)

    ID of email to set favourite state

  • favourited (Boolean)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


3342
3343
3344
3345
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3342

def set_email_favourited(email_id, favourited, opts = {})
  set_email_favourited_with_http_info(email_id, favourited, opts)
  nil
end

#set_email_favourited_with_http_info(email_id, favourited, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Set email favourited state Sets favourite state for an email for dashboard/search workflows.

Parameters:

  • email_id (String)

    ID of email to set favourite state

  • favourited (Boolean)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3353

def set_email_favourited_with_http_info(email_id, favourited, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.set_email_favourited ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.set_email_favourited"
  end
  # verify the required parameter 'favourited' is set
  if @api_client.config.client_side_validation && favourited.nil?
    fail ArgumentError, "Missing the required parameter 'favourited' when calling EmailControllerApi.set_email_favourited"
  end
  # resource path
  local_var_path = '/emails/{emailId}/favourite'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'favourited'] = favourited

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#set_email_favourited\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_email(email_id, opts = {}) ⇒ ValidationDto

Validate email HTML contents Runs HTML validation on the email body when HTML is present. Non-HTML emails are treated as valid for this check.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3408
3409
3410
3411
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3408

def validate_email(email_id, opts = {})
  data, _status_code, _headers = validate_email_with_http_info(email_id, opts)
  data
end

#validate_email_with_http_info(email_id, opts = {}) ⇒ Array<(ValidationDto, Integer, Hash)>

Validate email HTML contents Runs HTML validation on the email body when HTML is present. Non-HTML emails are treated as valid for this check.

Parameters:

  • email_id (String)

    ID of email

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ValidationDto, Integer, Hash)>)

    ValidationDto data, response status code and response headers



3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
# File 'lib/mailslurp_client/api/email_controller_api.rb', line 3418

def validate_email_with_http_info(email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailControllerApi.validate_email ...'
  end
  # verify the required parameter 'email_id' is set
  if @api_client.config.client_side_validation && email_id.nil?
    fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.validate_email"
  end
  # resource path
  local_var_path = '/emails/{emailId}/validate'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ValidationDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailControllerApi#validate_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end