Prepare GmailTransport.
This commit is contained in:
parent
1af2c621f4
commit
9eef404735
44
lib/Frs/Output/Transport/GmailTransport.php
Normal file
44
lib/Frs/Output/Transport/GmailTransport.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
@ -92,4 +92,9 @@ class SessionManager
|
|||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getGoogleClient()
|
||||||
|
{
|
||||||
|
return $this->client;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user