implementation of custom email templates

This commit is contained in:
David Bomba 2024-02-09 16:14:51 +11:00
parent ff072956cb
commit b513ceed11
6 changed files with 20 additions and 1 deletions

View File

@ -11,7 +11,6 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use DirectoryIterator;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;

View File

@ -74,6 +74,7 @@ class TokenAuth
*/ */
app('queue')->createPayloadUsing(function () use ($company_token) { app('queue')->createPayloadUsing(function () use ($company_token) {
return ['db' => $company_token->company->db]; return ['db' => $company_token->company->db];
// return ['db' => $company_token->company->db, 'is_premium' => $company_token->account->isPremium()];
}); });
//user who once existed, but has been soft deleted //user who once existed, but has been soft deleted

View File

@ -34,6 +34,7 @@ class NinjaMailer extends Mailable
*/ */
public function build() public function build()
{ {
$from_name = config('mail.from.name'); $from_name = config('mail.from.name');
if (property_exists($this->mail_obj, 'from_name')) { if (property_exists($this->mail_obj, 'from_name')) {

View File

@ -294,6 +294,11 @@ class Account extends BaseModel
return Ninja::isNinja() ? ($this->isPaidHostedClient() && !$this->isTrial()) : $this->hasFeature(self::FEATURE_WHITE_LABEL); return Ninja::isNinja() ? ($this->isPaidHostedClient() && !$this->isTrial()) : $this->hasFeature(self::FEATURE_WHITE_LABEL);
} }
public function isPremium(): bool
{
return Ninja::isHosted() && $this->isPaidHostedClient() && !$this->isTrial() && Carbon::createFromTimestamp($this->created_at)->diffInMonths() > 2;
}
public function isPaidHostedClient(): bool public function isPaidHostedClient(): bool
{ {
if (!Ninja::isNinja()) { if (!Ninja::isNinja()) {

View File

@ -24,6 +24,18 @@ class ComposerServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
view()->composer('portal.*', PortalComposer::class); view()->composer('portal.*', PortalComposer::class);
// view()->composer(
// ['email.admin.generic', 'email.client.generic'],
// function ($view) {
// $view->with(
// 'template',
// Ninja::isHosted()
// );
// }
// );
} }
/** /**

View File

@ -33,6 +33,7 @@ class MultiDBProvider extends ServiceProvider
*/ */
public function register() public function register()
{ {
$this->app['events']->listen( $this->app['events']->listen(
JobProcessing::class, JobProcessing::class,
function ($event) { function ($event) {