Skip to content

Commit

Permalink
Use Gmail-specific batch endpoint (#16)
Browse files Browse the repository at this point in the history
* Specify batch path

* Add .travis.yml
  • Loading branch information
foaly-nr1 authored Apr 3, 2018
1 parent 0334180 commit 7d8d5e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ matrix:
before_script:
- composer require "swiftmailer/swiftmailer:${SWIFT_VERSION}" --no-update
- composer install --no-interaction --dev

2 changes: 1 addition & 1 deletion Services/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function getBatch(string $userId, array $emailIds, array $options = []):

$batchResponses = [];
foreach (array_chunk($emailIds, 45) as $gmailIds) {
$batchRequest = new \Google_Http_Batch($gmailBatchClient);
$batchRequest = new \Google_Http_Batch($gmailBatchClient, false, null, 'batch/gmail/v1');
foreach ($gmailIds as $gmailId) {
/** @var RequestInterface $emailRequest */
$emailRequest = $gmailBatchService->users_messages->get($userId, $gmailId, $options);
Expand Down

0 comments on commit 7d8d5e3

Please sign in to comment.