1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

app/Mail/MigrationFailed.php

This commit is contained in:
Benjamin Beganović 2021-06-09 17:25:59 +02:00
parent 32fc72913b
commit e70effd404
3 changed files with 16 additions and 11 deletions

View File

@ -2,28 +2,27 @@
namespace App\Mail;
use Illuminate\Bus\Queueable;
use App\Models\Company;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class MigrationFailed extends Mailable
{
public $exception;
public $content;
public $settings;
public $company;
/**
* Create a new message instance.
*
* @param $content
* @param $exception
*/
public function __construct($exception, $company, $content = null)
public function __construct($exception, Company $company, $content = null)
{
$this->exception = $exception;
$this->content = $content;
$this->settings = $company->settings;
$this->company = $company;
}
@ -34,7 +33,11 @@ class MigrationFailed extends Mailable
*/
public function build()
{
return $this->from(config('mail.from.address'), config('mail.from.name'))
->view('email.migration.failed', ['settings' => $this->settings, 'company' => $this->company]);
return $this
->from(config('mail.from.address'), config('mail.from.name'))
->view('email.migration.failed', [
'logo' => $this->company->present()->logo(),
'settings' => $this->company->settings,
]);
}
}

View File

@ -4259,6 +4259,8 @@ $LANG = array(
'login_link_requested_label' => 'Login link requested',
'login_link_requested' => 'There was a request to login using link. If you did not request this, it\'s safe to ignore it.',
'invoices_backup_subject' => 'Your invoices are ready for download',
'migration_failed_label' => 'Migration failed',
'migration_failed' => 'Looks like something went wrong with the migration for the following company:',
);
return $LANG;

View File

@ -1,7 +1,7 @@
@component('email.template.admin-light', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png', 'settings' => $settings])
@component('email.template.admin', ['logo' => $logo, 'settings' => $settings])
<div class="center">
<h1>Whoops, migration failed for {{ $company->present()->name() }}.</h1>
<p>Looks like your migration failed. Here's the error message:</p>
<h1>{{ ctrans('texts.migration_failed_label') }}</h1>
<p>{{ ctrans('texts.migration_failed') }} {{ $company->present()->name() }}</p>
<pre>
@if(\App\Utils\Ninja::isHosted())