mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Admin: migration / max_companies.blade.php
This commit is contained in:
parent
456222eda8
commit
3aa18916bd
@ -17,6 +17,10 @@ use App\Factory\ClientFactory;
|
|||||||
use App\Factory\InvoiceFactory;
|
use App\Factory\InvoiceFactory;
|
||||||
use App\Factory\InvoiceInvitationFactory;
|
use App\Factory\InvoiceInvitationFactory;
|
||||||
use App\Jobs\Invoice\CreateEntityPdf;
|
use App\Jobs\Invoice\CreateEntityPdf;
|
||||||
|
use App\Jobs\Mail\NinjaMailerJob;
|
||||||
|
use App\Jobs\Mail\NinjaMailerObject;
|
||||||
|
use App\Mail\DownloadInvoices;
|
||||||
|
use App\Mail\Migration\MaxCompanies;
|
||||||
use App\Mail\TemplateEmail;
|
use App\Mail\TemplateEmail;
|
||||||
use App\Models\Account;
|
use App\Models\Account;
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
@ -60,9 +64,44 @@ class SendTestEmails extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->sendTemplateEmails('plain');
|
$faker = Factory::create();
|
||||||
$this->sendTemplateEmails('light');
|
|
||||||
$this->sendTemplateEmails('dark');
|
$account = Account::factory()->create();
|
||||||
|
|
||||||
|
$user = User::factory()->create([
|
||||||
|
'account_id' => $account->id,
|
||||||
|
'confirmation_code' => '123',
|
||||||
|
'email' => $faker->safeEmail,
|
||||||
|
'first_name' => 'John',
|
||||||
|
'last_name' => 'Doe',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$company = Company::factory()->create([
|
||||||
|
'account_id' => $account->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$user->companies()->attach($company->id, [
|
||||||
|
'account_id' => $account->id,
|
||||||
|
'is_owner' => 1,
|
||||||
|
'is_admin' => 1,
|
||||||
|
'is_locked' => 0,
|
||||||
|
'permissions' => '',
|
||||||
|
'notifications' => CompanySettings::notificationDefaults(),
|
||||||
|
//'settings' => DefaultSettings::userSettings(),
|
||||||
|
'settings' => null,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$nmo = new NinjaMailerObject;
|
||||||
|
$nmo->mailable = new DownloadInvoices('https://google.com', $user->account->companies()->first());
|
||||||
|
$nmo->company = $user->account->companies()->first();
|
||||||
|
$nmo->settings = $user->account->companies()->first()->settings;
|
||||||
|
$nmo->to_user = $user;
|
||||||
|
|
||||||
|
NinjaMailerJob::dispatch($nmo);
|
||||||
|
|
||||||
|
// $this->sendTemplateEmails('plain');
|
||||||
|
// $this->sendTemplateEmails('light');
|
||||||
|
// $this->sendTemplateEmails('dark');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function sendTemplateEmails($template)
|
private function sendTemplateEmails($template)
|
||||||
|
@ -1,18 +1,6 @@
|
|||||||
@component('email.template.master', ['design' => 'light', 'settings' => $settings])
|
@component('email.template.admin-light', ['logo' => $logo, 'settings' => $settings])
|
||||||
|
<div class="center">
|
||||||
@slot('header')
|
<h1>{{ ctrans('texts.max_companies') }}</h1>
|
||||||
@include('email.components.header', ['logo' => $logo])
|
<p>{{ ctrans('texts.max_companies_desc') }}</p>
|
||||||
@endslot
|
</div>
|
||||||
|
|
||||||
<h2>{{ctrans('texts.max_companies')}}</h2>
|
|
||||||
|
|
||||||
<p>{{ctrans('texts.max_companies_desc')}}</p>
|
|
||||||
|
|
||||||
@if(isset($whitelabel) && !$whitelabel)
|
|
||||||
@slot('footer')
|
|
||||||
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '© InvoiceNinja'])
|
|
||||||
For any info, please visit InvoiceNinja.
|
|
||||||
@endcomponent
|
|
||||||
@endslot
|
|
||||||
@endif
|
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
Loading…
Reference in New Issue
Block a user