Prepare GmailTransport.

This commit is contained in:
Markus Birth 2016-08-04 16:05:31 +02:00
parent 1af2c621f4
commit 9eef404735
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?php
namespace Frs\Output\Transport;
class GmailTransport implements TransportInterface
{
private $gms;
private $recipients;
private $subject;
private $headers;
private $content;
public function _construct(\Frs\SessionManager $sm)
{
$this->gms = new Google_Service_Gmail($sm->getGoogleClient());
}
public function setContent($content)
{
$this->content = $content;
}
public function setRecipients($recipients)
{
$this->recipients = $recipients;
}
public function setSubject($subject)
{
$this->subject = $subject;
}
public function setHeaders($headers)
{
$this->headers = $headers;
}
public function transmit()
{
$optParams = array();
$postBody = new Google_Service_Gmail_Message();
$this->gms->users_messages->send('me', $postBody, $optParams);
}
}

View File

@ -92,4 +92,9 @@ class SessionManager
);
return $result;
}
public function getGoogleClient()
{
return $this->client;
}
}