From 9eef404735193d43ccd429de55de7da1d7b8adbe Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 4 Aug 2016 16:05:31 +0200 Subject: [PATCH] Prepare GmailTransport. --- lib/Frs/Output/Transport/GmailTransport.php | 44 +++++++++++++++++++++ lib/Frs/SessionManager.php | 5 +++ 2 files changed, 49 insertions(+) create mode 100644 lib/Frs/Output/Transport/GmailTransport.php diff --git a/lib/Frs/Output/Transport/GmailTransport.php b/lib/Frs/Output/Transport/GmailTransport.php new file mode 100644 index 0000000..7dd3883 --- /dev/null +++ b/lib/Frs/Output/Transport/GmailTransport.php @@ -0,0 +1,44 @@ +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); + } +} diff --git a/lib/Frs/SessionManager.php b/lib/Frs/SessionManager.php index bbba7c7..e71e961 100644 --- a/lib/Frs/SessionManager.php +++ b/lib/Frs/SessionManager.php @@ -92,4 +92,9 @@ class SessionManager ); return $result; } + + public function getGoogleClient() + { + return $this->client; + } }