1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Merge pull request #4870 from turbo124/v5-develop

Working on GMail
This commit is contained in:
David Bomba 2021-02-11 10:38:59 +11:00 committed by GitHub
commit 8a533e59d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View File

@ -60,13 +60,15 @@ class GmailTransport extends Transport
$this->gmail->cc($message->getCc());
$this->gmail->bcc($message->getBcc());
nlog($message->getChildren());
foreach ($message->getChildren() as $child) {
nlog("trying to attach");
nlog($child->getContentType());
if($child->getContentType() == 'multipart/related')
$this->gmail->attach($child);
// foreach ($message->getChildren() as $child) {
// nlog("trying to attach");
// nlog($child);
// $this->gmail->attach($child);
// } //todo this should 'just work'
} //todo this should 'just work'
$this->gmail->send();

View File

@ -11,7 +11,7 @@ class GmailTransportManager extends MailManager
{
protected function createGmailTransport()
{
info('ping pong');
$token = $this->app['config']->get('services.gmail.token', []);
$mail = new Mail;

View File

@ -45,6 +45,7 @@ class BaseMailerJob implements ShouldQueue
{
/* Singletons need to be rebooted each time just in case our Locale is changing*/
App::forgetInstance('translator');
App::forgetInstance('mail.manager'); //singletons must be destroyed!
/* Inject custom translations if any exist */
Lang::replace(Ninja::transformTranslations($this->settings));

View File

@ -20,7 +20,7 @@ class MailServiceProvider extends MailProvider
return new GmailTransportManager($app);
});
// Copied from Illuminate\Mail\MailServiceProvider
$this->app->bind('mailer', function ($app) {
return $app->make('mail.manager')->mailer();
});