diff --git a/app/Providers/MailServiceProvider.php b/app/Providers/MailServiceProvider.php index dd7da7cd15df..5b971b4c2bb7 100644 --- a/app/Providers/MailServiceProvider.php +++ b/app/Providers/MailServiceProvider.php @@ -11,9 +11,7 @@ namespace App\Providers; -use App\Helpers\Mail\GmailTransportManager; use App\Utils\CssInlinerPlugin; -use Coconuts\Mail\PostmarkTransport; use GuzzleHttp\Client as HttpClient; use Illuminate\Container\Container; use Illuminate\Mail\MailServiceProvider as MailProvider; @@ -21,54 +19,30 @@ use Illuminate\Mail\TransportManager; class MailServiceProvider extends MailProvider { - public function register() - { - $this->registerIlluminateMailer(); - } public function boot() { // app('mail.manager')->getSymfonyTransport()->registerPlugin($this->app->make(CssInlinerPlugin::class)); } - protected function registerIlluminateMailer() + /** + * Register the service provider. + * + * @return void + */ + public function register() { - // //this is not octane safe - $this->app->singleton('mail.manager', function ($app) { - return new GmailTransportManager($app); - }); - - //this is octane ready - but is untested - // $this->app->bind('mail.manager', function ($app){ - // return new GmailTransportManager($app); - // }); - - $this->app->bind('mailer', function ($app) { - return $app->make('mail.manager')->mailer(); - }); - - $this->app['mail.manager']->extend('cocopostmark', function () { - return new PostmarkTransport( - $this->guzzle(config('postmark.guzzle', [])), - config('postmark.secret') - ); - }); + $this->registerIlluminateMailer(); + $this->registerMarkdownRenderer(); } - protected function guzzle(array $config): HttpClient + public function registerGmailApiMailer() { - return new HttpClient(array_merge($config, [ - 'base_uri' => empty($config['base_uri']) - ? 'https://api.postmarkapp.com' - : $config['base_uri'], - ])); + } - public function provides() + public function registerMicrosoftMailer() { - return [ - 'mail.manager', - 'mailer', - ]; + } } diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index cb1dc4980f8b..735d436c296b 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -354,7 +354,7 @@ trait MakesInvoiceValues $data[$key][$table_type.'.tax3'] = &$data[$key][$table_type.'.tax_rate3']; } - $data[$key]['task_id'] = $item->task_id; + $data[$key]['task_id'] = property_exists($item, 'task_id') ? $item->task_id : ''; } return $data; diff --git a/composer.json b/composer.json index 518b84fc74c6..6808d8ae84bc 100644 --- a/composer.json +++ b/composer.json @@ -84,11 +84,12 @@ "square/square": "13.0.0.20210721", "stripe/stripe-php": "^7.50", "symfony/http-client": "^6.0", + "symfony/mailgun-mailer": "^6.1", + "symfony/postmark-mailer": "^6.1", "tijsverkoyen/css-to-inline-styles": "^2.2", "turbo124/beacon": "^1.2", "webpatser/laravel-countries": "dev-master#75992ad", - "wepay/php-sdk": "^0.3", - "symfony/postmark-mailer": "^6.0" + "wepay/php-sdk": "^0.3" }, "require-dev": { "php": "^7.4|^8.0", diff --git a/composer.lock b/composer.lock index 9b43abaf3a57..166cdf3e696d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6876460f0cb90da2bc3e8b03d6c270b9", + "content-hash": "9c21b79c57e5ddfdd7c98a7b69773bd3", "packages": [ { "name": "afosto/yaac", @@ -9389,6 +9389,71 @@ ], "time": "2022-06-06T19:15:01+00:00" }, + { + "name": "symfony/mailgun-mailer", + "version": "v6.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/mailgun-mailer.git", + "reference": "44d3c15049d84f5165917a6190f06adbe64d71dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/44d3c15049d84f5165917a6190f06adbe64d71dd", + "reference": "44d3c15049d84f5165917a6190f06adbe64d71dd", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/mailer": "^5.4|^6.0" + }, + "require-dev": { + "symfony/http-client": "^5.4|^6.0" + }, + "type": "symfony-mailer-bridge", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\Bridge\\Mailgun\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Mailgun Mailer Bridge", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailgun-mailer/tree/v6.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-01T07:15:35+00:00" + }, { "name": "symfony/mime", "version": "v6.1.1", diff --git a/config/app.php b/config/app.php index 445a57e65d66..13222c030f18 100644 --- a/config/app.php +++ b/config/app.php @@ -169,7 +169,7 @@ return [ Illuminate\Filesystem\FilesystemServiceProvider::class, Illuminate\Foundation\Providers\FoundationServiceProvider::class, Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, + App\Providers\MailServiceProvider::class, Illuminate\Notifications\NotificationServiceProvider::class, Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class,