MailSlurp\TemplateControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
createTemplate | POST /templates | Create a Template |
deleteTemplate | DELETE /templates/{templateId} | Delete Template |
getAllTemplates | GET /templates/paginated | Get all Templates in paginated format |
getTemplate | GET /templates/{templateId} | Get Template |
getTemplates | GET /templates | Get all Templates |
updateTemplate | PUT /templates/{templateId} | Update a Template |
createTemplate
MailSlurpModelsTemplateDto createTemplate($create_template_options)
Create a Template
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 MailSlurpApiTemplateControllerApi(
// 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
);
$create_template_options = new MailSlurpModelsCreateTemplateOptions(); // MailSlurpModelsCreateTemplateOptions |
try {
$result = $apiInstance->createTemplate($create_template_options);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplateControllerApi->createTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Parameters
Name | Type | Description | Notes |
---|---|---|---|
create_template_options | MailSlurpModelsCreateTemplateOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
deleteTemplate
deleteTemplate($template_id)
Delete Template
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 MailSlurpApiTemplateControllerApi(
// 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
);
$template_id = 'template_id_example'; // string |
try {
$apiInstance->deleteTemplate($template_id);
} catch (Exception $e) {
echo 'Exception when calling TemplateControllerApi->deleteTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Parameters
Name | Type | Description | Notes |
---|---|---|---|
template_id | string |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to ]
getAllTemplates
MailSlurpModelsPageTemplateProjection getAllTemplates($page, $size, $sort, $since, $before)
Get all Templates in paginated format
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 MailSlurpApiTemplateControllerApi(
// 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
);
$page = 0; // int | Optional page in list pagination
$size = 20; // int | Optional page size in list pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC
$since = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at after the given timestamp
$before = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at before the given timestamp
try {
$result = $apiInstance->getAllTemplates($page, $size, $sort, $since, $before);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplateControllerApi->getAllTemplates: ', $e->getMessage(), PHP_EOL;
}
?>
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int | Optional page in list pagination | [optional] [default to 0] |
size | int | Optional page size in list pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to 'ASC'] |
since | DateTime | Filter by created at after the given timestamp | [optional] |
before | DateTime | Filter by created at before the given timestamp | [optional] |
Return type
MailSlurpModelsPageTemplateProjection
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
getTemplate
MailSlurpModelsTemplateDto getTemplate($template_id)
Get Template
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 MailSlurpApiTemplateControllerApi(
// 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
);
$template_id = 'template_id_example'; // string |
try {
$result = $apiInstance->getTemplate($template_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplateControllerApi->getTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Parameters
Name | Type | Description | Notes |
---|---|---|---|
template_id | string |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
getTemplates
MailSlurpModelsTemplateProjection[] getTemplates()
Get all Templates
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 MailSlurpApiTemplateControllerApi(
// 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
);
try {
$result = $apiInstance->getTemplates();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplateControllerApi->getTemplates: ', $e->getMessage(), PHP_EOL;
}
?>
Parameters
This endpoint does not need any parameter.
Return type
MailSlurpModelsTemplateProjection[]
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
updateTemplate
MailSlurpModelsTemplateDto updateTemplate($template_id, $create_template_options)
Update a Template
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 MailSlurpApiTemplateControllerApi(
// 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
);
$template_id = 'template_id_example'; // string |
$create_template_options = new MailSlurpModelsCreateTemplateOptions(); // MailSlurpModelsCreateTemplateOptions |
try {
$result = $apiInstance->updateTemplate($template_id, $create_template_options);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TemplateControllerApi->updateTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Parameters
Name | Type | Description | Notes |
---|---|---|---|
template_id | string | ||
create_template_options | MailSlurpModelsCreateTemplateOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]