Skip to content

Commit

Permalink
Extend information abput sent emails (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-mykhailenko authored Feb 10, 2024
1 parent 7c26ec0 commit b04c53a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Hydrator/ModelHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public function hydrate(ResponseInterface $response, string $class)
if (method_exists($object, 'setRawStream')) {
$object->setRawStream($response->getBody());
}
if (method_exists($object, 'setStatusCode')) {
$object->setStatusCode($response->getStatusCode());
}
if (method_exists($object, 'setHeaders')) {
$object->setHeaders($response->getHeaders());
}

return $object;
}
Expand Down
34 changes: 34 additions & 0 deletions src/Model/Message/SendResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ final class SendResponse implements ApiResponse
{
private $id;
private $message;
private $statusCode;
private $headers;

private function __construct()
{
Expand All @@ -43,4 +45,36 @@ public function getMessage(): string
{
return $this->message;
}

/**
* @return mixed
*/
public function getStatusCode()
{
return $this->statusCode;
}

/**
* @param mixed $statusCode
*/
public function setStatusCode($statusCode): void
{
$this->statusCode = $statusCode;
}

/**
* @return mixed
*/
public function getHeaders()
{
return $this->headers;
}

/**
* @param mixed $headers
*/
public function setHeaders($headers): void
{
$this->headers = $headers;
}
}

0 comments on commit b04c53a

Please sign in to comment.