mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
implementation of custom email templates
This commit is contained in:
parent
ff072956cb
commit
b513ceed11
@ -11,7 +11,6 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use DirectoryIterator;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
|
@ -74,6 +74,7 @@ class TokenAuth
|
||||
*/
|
||||
app('queue')->createPayloadUsing(function () use ($company_token) {
|
||||
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
|
||||
|
@ -34,6 +34,7 @@ class NinjaMailer extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
|
||||
$from_name = config('mail.from.name');
|
||||
|
||||
if (property_exists($this->mail_obj, 'from_name')) {
|
||||
|
@ -294,6 +294,11 @@ class Account extends BaseModel
|
||||
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
|
||||
{
|
||||
if (!Ninja::isNinja()) {
|
||||
|
@ -24,6 +24,18 @@ class ComposerServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
view()->composer('portal.*', PortalComposer::class);
|
||||
|
||||
// view()->composer(
|
||||
// ['email.admin.generic', 'email.client.generic'],
|
||||
// function ($view) {
|
||||
// $view->with(
|
||||
// 'template',
|
||||
// Ninja::isHosted()
|
||||
// );
|
||||
// }
|
||||
// );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,6 +33,7 @@ class MultiDBProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
|
||||
$this->app['events']->listen(
|
||||
JobProcessing::class,
|
||||
function ($event) {
|
||||
|
Loading…
Reference in New Issue
Block a user