Fix PHP error warning on createAuthorizedSenderDomain

And reload cache

[MAILPOET-5796]
This commit is contained in:
Brezo Cordero
2024-01-25 22:50:28 -06:00
committed by Aschepikov
parent d0f72b3b0e
commit 8177c3819c

View File

@@ -116,12 +116,12 @@ class AuthorizedSenderDomainController {
$response = $this->bridge->createAuthorizedSenderDomain($domain);
if ($response['status'] === API::RESPONSE_STATUS_ERROR) {
if (isset($response['status']) && $response['status'] === API::RESPONSE_STATUS_ERROR) {
throw new \InvalidArgumentException($response['message']);
}
// Reset cached value since a new domain was added
$this->currentRecords = null;
$this->reloadCache();
return $response;
}