diff --git a/src/Adapters/PostalAdapter.php b/src/Adapters/PostalAdapter.php index 23eded02..58904dc2 100644 --- a/src/Adapters/PostalAdapter.php +++ b/src/Adapters/PostalAdapter.php @@ -7,7 +7,7 @@ use DomainException; use Illuminate\Support\Arr; use Postal\Client; -use Postal\SendMessage; +use Postal\Send\Message; use Sendportal\Base\Services\Messages\MessageTrackingOptions; class PostalAdapter extends BaseMailAdapter @@ -20,12 +20,12 @@ public function send(string $fromEmail, string $fromName, string $toEmail, strin { $client = new Client('https://' . Arr::get($this->config, 'postal_host'), Arr::get($this->config, 'key')); - $message = new SendMessage($client); + $message = new Message($client); $message->to($toEmail); $message->from($fromName.' <'.$fromEmail.'>'); $message->subject($subject); $message->htmlBody($content); - $response = $message->send(); + $response = $client->send->message($message); return $this->resolveMessageId($response); } @@ -35,7 +35,7 @@ public function send(string $fromEmail, string $fromName, string $toEmail, strin protected function resolveMessageId($response): string { foreach ($response->recipients() as $email => $message) { - return (string) $message->id(); + return (string) $message->id; } throw new DomainException('Unable to resolve message ID');