mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
code cleanup
This commit is contained in:
parent
86f97cc443
commit
0fb7f58851
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
|
||||
namespace App\Helpers\Mail;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Mail\SupportMessageSent;
|
||||
use App\Models\User;
|
||||
use App\Providers\MailServiceProvider;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Laravel\Socialite\Facades\Socialite;
|
||||
|
||||
/**
|
||||
* GmailTransportConfig.
|
||||
*/
|
||||
class GmailTransportConfig
|
||||
{
|
||||
public function test()
|
||||
{
|
||||
/********************* We may need to fetch a new token on behalf of the client ******************************/
|
||||
$query = [
|
||||
'email' => 'david@invoiceninja.com',
|
||||
];
|
||||
|
||||
$user = MultiDB::hasUser($query);
|
||||
// $oauth_user = Socialite::driver('google')->stateless()->userFromToken($user->oauth_user_token);
|
||||
|
||||
// $user->oauth_user_token = $oauth_user->refreshToken;
|
||||
// $user->save();
|
||||
|
||||
Config::set('mail.driver', 'gmail');
|
||||
Config::set('services.gmail.token', $user->oauth_user_token);
|
||||
(new MailServiceProvider(app()))->register();
|
||||
|
||||
Mail::to('david@romulus.com.au')
|
||||
->send(new SupportMessageSent('a cool message'));
|
||||
}
|
||||
}
|
@ -132,7 +132,7 @@ class EmailController extends BaseController
|
||||
$entity_obj->service()->markSent()->save();
|
||||
|
||||
EmailEntity::dispatch($invitation->fresh(), $invitation->company, $template, $data)
|
||||
->delay(now()->addSeconds(60));
|
||||
->delay(now()->addSeconds(30));
|
||||
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,9 @@ class CreateEntityPdf implements ShouldQueue
|
||||
if ($pdf) {
|
||||
|
||||
try{
|
||||
|
||||
|
||||
nlog($file_path);
|
||||
|
||||
Storage::disk($this->disk)->put($file_path, $pdf);
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class MailServiceProvider extends MailProvider
|
||||
protected function registerIlluminateMailer()
|
||||
{
|
||||
$this->app->singleton('mail.manager', function($app) {
|
||||
return new GmailTransportManager($app);
|
||||
return new GmailTransportManager($app);
|
||||
});
|
||||
|
||||
// $this->app->bind('mail.manager', function($app) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user