Currently in our system I send emails by using the laravel mailables like so
Mail::to($user)->send(new AccountCreation($user))
This works as intended however in our system we have some complex global rules for when to send an email to a person that should be used everywhere, for example:
if ($user->isActive) {
Mail::to($user)->send(new AccountCreation($user));
}
I do not want to check the user every time and would rather the mailable logic handle this.
Is there a clean way to handle global rules for when to send an email?