Skip to content

Commit

Permalink
fix(mailer): return response instead of message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmard committed Mar 9, 2024
1 parent fc33e99 commit 9d178d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
* @param string|null $callback
* @param bool $callbackOnSuccess Weather to call you back when the webhook accept this impulse
* @param bool $callbackOnFailure Weather to call you back when the webhook reject this impulse or throws error handling it
* @return string
* @return MailerResponse
* @throws GuzzleException
* @throws RequestFailureException
*/
Expand All @@ -61,7 +61,7 @@ public function send(
?string $callback = null,
bool $callbackOnSuccess = false,
bool $callbackOnFailure = false,
): string
): MailerResponse
{
$this->withData([
'mails' => $mails,
Expand All @@ -70,11 +70,9 @@ public function send(
'callback_on_failure' => $callbackOnFailure,
]);

$response = MailerResponse::new(response: $this->client->post(
return MailerResponse::new(response: $this->client->post(
uri: sprintf('applications/%s/mails', $appId),
options: $this->getClientOptions(),
));

return $response->message();
}
}

0 comments on commit 9d178d8

Please sign in to comment.