Skip to content

Commit cc080a9

Browse files
authored
Update Office365Connector.php
Signed-off-by: Kristóf Tischler <107202954+TKrisee@users.noreply.github.com>
1 parent 5228564 commit cc080a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Mailers/O365/Office365Connector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,17 @@ protected function getAccessToken(): string
5757
return $token->access_token;
5858
}
5959

60+
protected function refreshClientToken(): void
61+
{
62+
$this->client->setAccessToken($this->getAccessToken());
63+
}
64+
6065
/**
6166
* Send a request to the API to send out the email.
6267
*/
6368
public function sendMessageRequest(Email $message): Message
6469
{
70+
$this->refreshClientToken();
6571
// If the whole message body is bigger than 4MB we'll handle it differently
6672
if ($this->getBodySize($message) >= 4) {
6773
// Create a draft message

0 commit comments

Comments
 (0)