MailSlurpClient::CommonActionsControllerApi

All URIs are relative to https://api.mailslurp.com

MethodHTTP requestDescription
create_new_email_addressPOST /createInboxCreate new random inbox
create_new_email_address1POST /newEmailAddressCreate new random inbox
empty_inboxDELETE /emptyInboxDelete all emails in an inbox
send_email_simplePOST /sendEmailSend an email

create_new_email_address

Inbox create_new_email_address(opts)

Create new random inbox

Returns an Inbox with an id and an emailAddress

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::CommonActionsControllerApi.new
opts = {
  allow_team_access: true, # Boolean | allowTeamAccess
  description: 'description_example', # String | description
  email_address: 'email_address_example', # String | emailAddress
  expires_at: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | expiresAt
  expires_in: 56, # Integer | expiresIn
  favourite: true, # Boolean | favourite
  inbox_type: 'inbox_type_example', # String | inboxType
  name: 'name_example', # String | name
  tags: ['tags_example'], # Array<String> | tags
  use_domain_pool: true # Boolean | useDomainPool
}

begin
  #Create new random inbox
  result = api_instance.create_new_email_address(opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling CommonActionsControllerApi->create_new_email_address: #{e}"
end

Parameters

NameTypeDescriptionNotes
allow_team_accessBooleanallowTeamAccess[optional]
descriptionStringdescription[optional]
email_addressStringemailAddress[optional]
expires_atDateTimeexpiresAt[optional]
expires_inIntegerexpiresIn[optional]
favouriteBooleanfavourite[optional]
inbox_typeStringinboxType[optional]
nameStringname[optional]
tagsArraytags[optional]
use_domain_poolBooleanuseDomainPool[optional]

Return type

Inbox

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

create_new_email_address1

Inbox create_new_email_address1(opts)

Create new random inbox

Returns an Inbox with an id and an emailAddress

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::CommonActionsControllerApi.new
opts = {
  allow_team_access: true, # Boolean | allowTeamAccess
  description: 'description_example', # String | description
  email_address: 'email_address_example', # String | emailAddress
  expires_at: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | expiresAt
  expires_in: 56, # Integer | expiresIn
  favourite: true, # Boolean | favourite
  inbox_type: 'inbox_type_example', # String | inboxType
  name: 'name_example', # String | name
  tags: ['tags_example'], # Array<String> | tags
  use_domain_pool: true # Boolean | useDomainPool
}

begin
  #Create new random inbox
  result = api_instance.create_new_email_address1(opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling CommonActionsControllerApi->create_new_email_address1: #{e}"
end

Parameters

NameTypeDescriptionNotes
allow_team_accessBooleanallowTeamAccess[optional]
descriptionStringdescription[optional]
email_addressStringemailAddress[optional]
expires_atDateTimeexpiresAt[optional]
expires_inIntegerexpiresIn[optional]
favouriteBooleanfavourite[optional]
inbox_typeStringinboxType[optional]
nameStringname[optional]
tagsArraytags[optional]
use_domain_poolBooleanuseDomainPool[optional]

Return type

Inbox

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

empty_inbox

empty_inbox(inbox_id)

Delete all emails in an inbox

Deletes all emails

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::CommonActionsControllerApi.new
inbox_id = 'inbox_id_example' # String | inboxId

begin
  #Delete all emails in an inbox
  api_instance.empty_inbox(inbox_id)
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling CommonActionsControllerApi->empty_inbox: #{e}"
end

Parameters

NameTypeDescriptionNotes
inbox_idStringinboxId

Return type

nil (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

send_email_simple

send_email_simple(email_options)

Send an email

If no senderId or inboxId provided a random email address will be used to send from.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::CommonActionsControllerApi.new
email_options = MailSlurpClient::SimpleSendEmailOptions.new # SimpleSendEmailOptions | emailOptions

begin
  #Send an email
  api_instance.send_email_simple(email_options)
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling CommonActionsControllerApi->send_email_simple: #{e}"
end

Parameters

NameTypeDescriptionNotes
email_optionsSimpleSendEmailOptionsemailOptions

Return type

nil (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined