Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make subject and body configurable through option #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/AcornMailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AcornMailServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app->singleton('Roots\AcornMail', fn () => AcornMail::make($this->app));
$this->app->singleton(AcornMail::class, fn () => AcornMail::make($this->app));
}

/**
Expand All @@ -30,6 +30,6 @@ public function boot()
]);
}

$this->app->make('Roots\AcornMail');
$this->app->make(AcornMail::class);
}
}
5 changes: 3 additions & 2 deletions src/Console/Commands/MailTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Console\Command;
use Illuminate\Support\Str;
use Roots\AcornMail\AcornMail;

class MailTestCommand extends Command
{
Expand Down Expand Up @@ -47,7 +48,7 @@ class MailTestCommand extends Command
*/
public function handle()
{
$package = app('Roots\AcornMail');
$package = app()->make(AcornMail::class);

if (! $package->configured()) {
$this->components->error('The mail SMTP configuration is not set.');
Expand All @@ -64,7 +65,7 @@ public function handle()
$config = collect($phpmailer)
->filter(fn ($value, $key) => in_array($key, array_keys($this->options)))
->map(fn ($value, $key) => $key === 'Password' ? Str::mask($value, '*', 0) : $value)
->map(fn ($value, $key) => Str::finish($this->options[$key], ': ').(is_null($value) || empty($value) ? 'Not set' : "<fg=blue>{$value}</>"));
->map(fn ($value, $key) => Str::finish($this->options[$key], ': ') . (is_null($value) || empty($value) ? 'Not set' : "<fg=blue>{$value}</>"));

$this->components->bulletList($config);
});
Expand Down
Loading