Skip to content

MailSlurp\CommonActionsControllerApi

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

Method HTTP request Description
createNewEmailAddress() POST /newEmailAddress Create new random inbox
createRandomInbox() POST /createInbox Create new random inbox
deleteEmailAddress() DELETE /deleteEmailAddress Delete inbox email address by inbox id
emptyInbox() DELETE /emptyInbox Delete all emails in an inbox
sendEmailSimple() POST /sendEmail Send an email

createNewEmailAddress()

createNewEmailAddress($allow_team_access, $use_domain_pool, $expires_at, $expires_in, $email_address, $inbox_type, $description, $name, $tags, $favourite, $virtual_inbox): MailSlurpModelsInboxDto

Create new random inbox

Returns an Inbox with an id and an emailAddress

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$allow_team_access = True; // bool
$use_domain_pool = True; // bool
$expires_at = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime
$expires_in = 56; // int
$email_address = 'email_address_example'; // string
$inbox_type = 'inbox_type_example'; // string
$description = 'description_example'; // string
$name = 'name_example'; // string
$tags = array('tags_example'); // string[]
$favourite = True; // bool
$virtual_inbox = True; // bool

try {
    $result = $apiInstance->createNewEmailAddress($allow_team_access, $use_domain_pool, $expires_at, $expires_in, $email_address, $inbox_type, $description, $name, $tags, $favourite, $virtual_inbox);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->createNewEmailAddress: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
allow_team_access bool [optional]
use_domain_pool bool [optional]
expires_at DateTime [optional]
expires_in int [optional]
email_address string [optional]
inbox_type string [optional]
description string [optional]
name string [optional]
tags string[] [optional]
favourite bool [optional]
virtual_inbox bool [optional]

Return type

MailSlurpModelsInboxDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

createRandomInbox()

createRandomInbox($allow_team_access, $use_domain_pool, $expires_at, $expires_in, $email_address, $inbox_type, $description, $name, $tags, $favourite, $virtual_inbox): MailSlurpModelsInboxDto

Create new random inbox

Returns an Inbox with an id and an emailAddress

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$allow_team_access = True; // bool
$use_domain_pool = True; // bool
$expires_at = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime
$expires_in = 56; // int
$email_address = 'email_address_example'; // string
$inbox_type = 'inbox_type_example'; // string
$description = 'description_example'; // string
$name = 'name_example'; // string
$tags = array('tags_example'); // string[]
$favourite = True; // bool
$virtual_inbox = True; // bool

try {
    $result = $apiInstance->createRandomInbox($allow_team_access, $use_domain_pool, $expires_at, $expires_in, $email_address, $inbox_type, $description, $name, $tags, $favourite, $virtual_inbox);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->createRandomInbox: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
allow_team_access bool [optional]
use_domain_pool bool [optional]
expires_at DateTime [optional]
expires_in int [optional]
email_address string [optional]
inbox_type string [optional]
description string [optional]
name string [optional]
tags string[] [optional]
favourite bool [optional]
virtual_inbox bool [optional]

Return type

MailSlurpModelsInboxDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

deleteEmailAddress()

deleteEmailAddress($inbox_id)

Delete inbox email address by inbox id

Deletes inbox email address

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$inbox_id = 'inbox_id_example'; // string

try {
    $apiInstance->deleteEmailAddress($inbox_id);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->deleteEmailAddress: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
inbox_id string

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

emptyInbox()

emptyInbox($inbox_id)

Delete all emails in an inbox

Deletes all emails

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$inbox_id = 'inbox_id_example'; // string

try {
    $apiInstance->emptyInbox($inbox_id);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->emptyInbox: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
inbox_id string

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

sendEmailSimple()

sendEmailSimple($simple_send_email_options)

Send an email

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

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$simple_send_email_options = new MailSlurpModelsSimpleSendEmailOptions(); // MailSlurpModelsSimpleSendEmailOptions

try {
    $apiInstance->sendEmailSimple($simple_send_email_options);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->sendEmailSimple: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
simple_send_email_options MailSlurpModelsSimpleSendEmailOptions

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]