Skip to content

Commit d5d7ff0

Browse files
authored
Merge pull request #12 from inlinestudio/TKrisee-patch-2
Update Office365Connector.php
2 parents 5228564 + cc080a9 commit d5d7ff0

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)