56 lines
1.3 KiB
Markdown
56 lines
1.3 KiB
Markdown
# POST Send test mail
|
|
This API call will send an test email to the given mail address.
|
|
|
|
#### Location
|
|
```
|
|
/api/v1/portal-management/mail/test/
|
|
```
|
|
|
|
#### Permissions required
|
|
`ofice-stompjes-canstomp` RW
|
|
|
|
#### Body parameters
|
|
| Parameter | Type | Required | Description |
|
|
| --------- | ----- | -------- | -------------------------------------------- |
|
|
| mailt_to | email | yes | The mail address to send the test email to. |
|
|
|
|
### Example Body (json)
|
|
```json
|
|
{
|
|
"mail_to": "test@company.com",
|
|
}
|
|
```
|
|
|
|
### Example Request
|
|
```php
|
|
$curl = curl_init();
|
|
|
|
curl_setopt_array($curl, [
|
|
CURLOPT_URL => $baseUrl . '/api/v1/portal-management/mail/test/',
|
|
CURLOPT_RETURNTRANSFER => true,
|
|
CURLOPT_POST => true,
|
|
CURLOPT_POSTFIELDS => $json_payload,
|
|
CURLOPT_HTTPHEADER => [
|
|
'Authorization: Bearer ' . $token,
|
|
'Content-Type: application/json',
|
|
],
|
|
]);
|
|
|
|
$response = curl_exec($curl);
|
|
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
|
|
|
if ($response === false) {
|
|
echo curl_error($curl);
|
|
}
|
|
|
|
curl_close($curl);
|
|
```
|
|
|
|
### Example Response
|
|
```json
|
|
"The test email was sent."
|
|
```
|
|
|
|
#### Known errors or issues.
|
|
None are known at the time
|
|
If you do encounter issues and get an http code in return, check the response codes on this page. |