Fix email templates and handler for #4586

This commit is contained in:
James Cole 2021-04-03 12:25:35 +02:00
parent 472497cafd
commit e6012e1ca2
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
49 changed files with 84 additions and 440 deletions

View File

@ -34,6 +34,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException as LaravelValidationException;
use League\OAuth2\Server\Exception\OAuthServerException;
use Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
@ -44,6 +45,13 @@ use Throwable;
*/
class Handler extends ExceptionHandler
{
/**
* @var array
*/
protected $dontReport
= [
];
/**
* Render an exception into an HTTP response.
*
@ -114,47 +122,47 @@ class Handler extends ExceptionHandler
*
* // it's five its fine.
*
* @param Exception $exception
* @param Throwable $e
*
* @return void
* @throws Exception
*
*/
public function report(Throwable $exception)
public function report(Throwable $e)
{
$doMailError = config('firefly.send_error_message');
// if the user wants us to mail:
if (true === $doMailError
// and if is one of these error instances
&& ($exception instanceof FireflyException || $exception instanceof ErrorException)) {
$userData = [
'id' => 0,
'email' => 'unknown@example.com',
];
if (auth()->check()) {
$userData['id'] = auth()->user()->id;
$userData['email'] = auth()->user()->email;
}
$data = [
'class' => get_class($exception),
'errorMessage' => $exception->getMessage(),
'time' => date('r'),
'stackTrace' => $exception->getTraceAsString(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'code' => $exception->getCode(),
'version' => config('firefly.version'),
'url' => request()->fullUrl(),
'userAgent' => request()->userAgent(),
'json' => request()->acceptsJson(),
];
// create job that will mail.
$ipAddress = request()->ip() ?? '0.0.0.0';
$job = new MailError($userData, (string)config('firefly.site_owner'), $ipAddress, $data);
dispatch($job);
if ($this->shouldntReport($e) || !$doMailError) {
Log::info('Will not report on this error.');
parent::report($e);
return;
}
$userData = [
'id' => 0,
'email' => 'unknown@example.com',
];
if (auth()->check()) {
$userData['id'] = auth()->user()->id;
$userData['email'] = auth()->user()->email;
}
$data = [
'class' => get_class($e),
'errorMessage' => $e->getMessage(),
'time' => date('r'),
'stackTrace' => $e->getTraceAsString(),
'file' => $e->getFile(),
'line' => $e->getLine(),
'code' => $e->getCode(),
'version' => config('firefly.version'),
'url' => request()->fullUrl(),
'userAgent' => request()->userAgent(),
'json' => request()->acceptsJson(),
];
parent::report($exception);
// create job that will mail.
$ipAddress = request()->ip() ?? '0.0.0.0';
$job = new MailError($userData, (string)config('firefly.site_owner'), $ipAddress, $data);
dispatch($job);
parent::report($e);
}
}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.access_token_created_body') }}
</p>
@ -10,4 +10,4 @@
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.access_token_created_revoke', {url: route('profile.index') }) }}
</p>
{% include 'v1.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,7 +1,7 @@
{% include 'v2.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.access_token_created_body')|raw }}
{{ trans('email.access_token_created_explanation')|striptags|raw }}
{{ trans('email.access_token_created_revoke', {url: route('profile.index') })|raw }}
{% include 'v2.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,5 +1,5 @@
{% include 'v2.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.admin_test_body', {email: email })}}
</p>
{% include 'v2.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -0,0 +1,3 @@
{% include 'emails.header-text' %}
{{ trans('email.admin_test_body', {email: email })|raw }}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.email_change_body_to_new')}}
</p>
@ -15,4 +15,4 @@
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
<a href="{{ uri }}">{{ uri }}</a>
</p>
{% include 'v1.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,4 +1,4 @@
{% include 'v2.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.email_change_body_to_new')|raw }}
{{trans('email.email_change_old', { email: oldEmail })|raw }}
@ -7,4 +7,4 @@
{{ trans('email.email_change_instructions')|raw }}
{{ uri }}
{% include 'v2.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_intro', { version: version, errorMessage: errorMessage })|raw }}
</p>
@ -42,4 +42,4 @@
<p style="font-family: monospace;font-size:11px;color:#aaa">
{{ stackTrace|nl2br }}
</p>
{% include 'v1.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,4 +1,4 @@
{% include 'v2.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.error_intro', { version: version, errorMessage: errorMessage })|striptags|raw }}
{{ trans('email.error_type', {class: class })|raw }}
@ -24,4 +24,4 @@
{{ trans('email.error_stacktrace_below')|raw }}
{{ stackTrace|raw }}
{% include 'v2.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.new_ip_body') }}
</p>
@ -13,4 +13,4 @@
{{ trans('email.new_ip_warning') }}
</p>
{% include 'v1.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.new_ip_body') }}
{{ trans('email.ip_address') }}: {{ ipAddress }}
@ -7,4 +7,4 @@
{{ trans('email.new_ip_warning') }}
{% include 'v1.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v2.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.oauth_created_body', { name:client.name, url: client.redirect })|raw }}
</p>
@ -10,4 +10,4 @@
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.oauth_created_undo', { url:route('profile.index')}) }}
</p>
{% include 'v2.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,7 +1,7 @@
{% include 'v2.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.oauth_created_body', {name: client.name, url: client.redirect })|striptags|raw }}
{{ trans('email.oauth_created_explanation')|striptags|raw }}
{{ trans('email.oauth_created_undo', { url:route('profile.index')})|raw }}
{% include 'v2.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v2.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.reset_pw_instructions') }}
</p>
@ -10,4 +10,4 @@
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
<a href="{{ url }}">{{ url }}</a>
</p>
{% include 'v2.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,7 +1,7 @@
{% include 'v2.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.reset_pw_instructions')|raw }}
{{ trans('email.reset_pw_warning')|striptags|raw }}
{{ url }}
{% include 'v2.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.registered_welcome', {address: address})|raw }}
</p>
@ -17,4 +17,4 @@
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.registered_closing')}}
</p>
{% include 'v1.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.registered_welcome')|striptags|raw }}
@ -18,4 +18,4 @@
https://github.com/firefly-iii/firefly-iii
https://firefly-iii.org/
{% include 'v1.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans_choice('email.new_journals_header', transformed|length ) }}
</p>
@ -75,4 +75,4 @@
{% endfor %}
</ol>
{% include 'v1.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans_choice('email.new_journals_header', transformed|length )|raw }}
@ -13,4 +13,4 @@
{% endfor %}
{% endif %}
{% endfor %}
{% include 'v1.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,4 +1,4 @@
{% include 'v1.emails.header-html' %}
{% include 'emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.email_change_body_to_old')|raw }}
</p>
@ -14,4 +14,4 @@
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{trans('email.email_change_undo_link')}} <a href="{{ uri }}">{{ uri }}</a>
</p>
{% include 'v1.emails.footer-html' %}
{% include 'emails.footer-html' %}

View File

@ -1,4 +1,4 @@
{% include 'v2.emails.header-text' %}
{% include 'emails.header-text' %}
{{ trans('email.email_change_body_to_old')|striptags|raw }}
{{ trans('email.email_change_ignore')|raw }}
@ -8,4 +8,4 @@
{{trans('email.email_change_new', { email: newEmail })|raw }}
{{ trans('email.email_change_undo_link')|raw }} {{ uri }}
{% include 'v2.emails.footer-text' %}
{% include 'emails.footer-text' %}

View File

@ -1,7 +0,0 @@
{% include 'v1.emails.header-text' %}
{{ trans('email.access_token_created_body')|raw }}
{{ trans('email.access_token_created_explanation')|striptags|raw }}
{{ trans('email.access_token_created_revoke', {url: route('profile.index') })|raw }}
{% include 'v1.emails.footer-text' %}

View File

@ -1,5 +0,0 @@
{% include 'v1.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.admin_test_body', {email: email })}}
</p>
{% include 'v1.emails.footer-html' %}

View File

@ -1,3 +0,0 @@
{% include 'v1.emails.header-text' %}
{{ trans('email.admin_test_body', {email: email })|raw }}
{% include 'v1.emails.footer-text' %}

View File

@ -1,10 +0,0 @@
{% include 'v1.emails.header-text' %}
{{ trans('email.email_change_body_to_new')|raw }}
{{trans('email.email_change_old', { email: oldEmail })|raw }}
{{trans('email.email_change_new', { email: newEmail })|raw }}
{{ trans('email.email_change_instructions')|raw }}
{{ uri }}
{% include 'v1.emails.footer-text' %}

View File

@ -1,27 +0,0 @@
{% include 'v1.emails.header-text' %}
{{ trans('email.error_intro', { version: version, errorMessage: errorMessage })|striptags|raw }}
{{ trans('email.error_type', {class: class })|raw }}
{{ trans('email.error_timestamp', {time: time })|raw }}
{{ trans('email.error_location', { file: file , line: line, code: code })|striptags|raw }}
{% if loggedIn %}
{{ trans('email.error_user', { id: user.id, email: user.email })|striptags|raw }}
{% else %}
{{ trans('email.error_no_user')|raw }}
{% endif %}
{{ trans('email.error_ip', { ip: ip }) }}
{{ trans('email.error_url', {url :url}) }}
{{ trans('email.error_user_agent', {userAgent: userAgent } ) }}
{{ trans('email.error_stacktrace')|striptags|raw }}
{{ trans('email.error_github_text' )|raw }}
{{ trans('email.error_stacktrace_below')|raw }}
{{ stackTrace|raw }}
{% include 'v1.emails.footer-text' %}

View File

@ -1,13 +0,0 @@
{% include 'v1.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.oauth_created_body', { name:client.name, url: client.redirect })|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.oauth_created_explanation')|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.oauth_created_undo', { url:route('profile.index')}) }}
</p>
{% include 'v1.emails.footer-html' %}

View File

@ -1,7 +0,0 @@
{% include 'v1.emails.header-text' %}
{{ trans('email.oauth_created_body', {name: client.name, url: client.redirect })|striptags|raw }}
{{ trans('email.oauth_created_explanation')|striptags|raw }}
{{ trans('email.oauth_created_undo', { url:route('profile.index')})|raw }}
{% include 'v1.emails.footer-text' %}

View File

@ -1,13 +0,0 @@
{% include 'v1.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.reset_pw_instructions') }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.reset_pw_warning')|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
<a href="{{ url }}">{{ url }}</a>
</p>
{% include 'v1.emails.footer-html' %}

View File

@ -1,7 +0,0 @@
{% include 'v1.emails.header-text' %}
{{ trans('email.reset_pw_instructions')|raw }}
{{ trans('email.reset_pw_warning')|striptags|raw }}
{{ url }}
{% include 'v1.emails.footer-text' %}

View File

@ -1,11 +0,0 @@
{% include 'v1.emails.header-text' %}
{{ trans('email.email_change_body_to_old')|striptags|raw }}
{{ trans('email.email_change_ignore')|raw }}
{{trans('email.email_change_old', { email: oldEmail })|raw }}
{{trans('email.email_change_new', { email: newEmail })|raw }}
{{ trans('email.email_change_undo_link')|raw }} {{ uri }}
{% include 'v1.emails.footer-text' %}

View File

@ -1,13 +0,0 @@
{% include 'v2.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.access_token_created_body') }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.access_token_created_explanation')|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.access_token_created_revoke', {url: route('profile.index') }) }}
</p>
{% include 'v2.emails.footer-html' %}

View File

@ -1,3 +0,0 @@
{% include 'v2.emails.header-text' %}
{{ trans('email.admin_test_body', {email: email })|raw }}
{% include 'v2.emails.footer-text' %}

View File

@ -1,18 +0,0 @@
{% include 'v2.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.email_change_body_to_new')}}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{trans('email.email_change_old', { email: oldEmail }) }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{trans('email.email_change_new_strong', { email: newEmail })|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.email_change_instructions')}}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
<a href="{{ uri }}">{{ uri }}</a>
</p>
{% include 'v2.emails.footer-html' %}

View File

@ -1,45 +0,0 @@
{% include 'v2.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_intro', { version: version, errorMessage: errorMessage })|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_type', {class: class }) }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_timestamp', {time: time }) }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_location', { file: file, line: line, code: code })|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{% if loggedIn %}
{{ trans('email.error_user', { id: user.id, email: user.email })|raw }}
{% else %}
{{ trans('email.error_no_user') }}
{% endif %}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_ip', { ip: ip }) }}<br />
{{ trans('email.error_url', {url :url }) }}<br />
{{ trans('email.error_user_agent', {userAgent: userAgent }) }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_stacktrace')|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_github_html')|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.error_stacktrace_below') }}</p>
<p style="font-family: monospace;font-size:11px;color:#aaa">
{{ stackTrace|nl2br }}
</p>
{% include 'v2.emails.footer-html' %}

View File

@ -1,13 +0,0 @@
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.closing') }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.signature') }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">
{{ trans('email.footer_ps', {ipAddress: ipAddress}) }}
</p>
</body>
</html>

View File

@ -1,6 +0,0 @@
{{ trans('email.closing')|raw }}
{{ trans('email.signature')|raw }}
{{ trans('email.footer_ps', {ipAddress: ipAddress})|raw }}

View File

@ -1,10 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.greeting') }}
</p>

View File

@ -1,2 +0,0 @@
{{ trans('email.greeting')|raw }}

View File

@ -1,20 +0,0 @@
{% include 'v2.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.registered_welcome', {address: address})|raw }}
</p>
<ul>
<li style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.registered_pw', {address: address})|raw }}
</li>
<li style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.registered_help')}}
</li>
<li style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.registered_doc_html')|raw }}
</li>
</ul>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.registered_closing')}}
</p>
{% include 'v2.emails.footer-html' %}

View File

@ -1,21 +0,0 @@
{% include 'v2.emails.header-text' %}
{{ trans('email.registered_welcome')|striptags|raw }}
* {{ trans('email.registered_pw')|striptags|raw }}
* {{ trans('email.registered_help')|raw }}
* {{ trans('email.registered_doc_text')|raw }}
{{ trans('email.registered_closing')|raw }}
{{ trans('email.registered_firefly_iii_link')|raw }}
{{ address }}
{{ trans('email.registered_pw_reset_link')|raw }}
{{ address }}/password/reset
{{ trans('email.registered_doc_link')}}
https://github.com/firefly-iii/firefly-iii
https://firefly-iii.org/
{% include 'v2.emails.footer-text' %}

View File

@ -1,78 +0,0 @@
{% include 'v2.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans_choice('email.new_journals_header', transformed|length ) }}
</p>
<!-- loop groups -->
<ol>
{% for group in transformed %}
<li>
{% set count = group.transactions|length %}
<!-- if journals === 1, skip straight to journals. -->
{% if 1 == count %}
{% set journal = group.transactions[0] %}
<a href="{{ route('transactions.show', [group.id]) }}">{{ journal.description }}</a>,
<!-- amount -->
{% if journal.type == 'deposit' %}
<span style="color:#3c763d;">
{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount*-1 %}
({{ formatAmountBySymbol(journal.foreign_amount|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% elseif journal.type == 'transfer' %}
<span style="color:#31708f">
{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol((journal.foreign_amount*-1)|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% else %}
<span style="color:#a94442">
{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol((journal.foreign_amount*-1)|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% endif %}
<!-- / amount -->
{% else %}
<a href="{{ route('transactions.show', [group.id]) }}">{{ group.group_title }}</a>
<ol>
{% for journal in group.transactions %}
<li>
{{ journal.description }},
<!-- amount -->
{% if journal.type == 'deposit' %}
<span style="color:#3c763d;">
{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount*-1 %}
({{ formatAmountBySymbol(journal.foreign_amount|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% elseif journal.type == 'transfer' %}
<span style="color:#31708f">
{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol((journal.foreign_amount*-1)|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% else %}
<span style="color:#a94442">
{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol((journal.foreign_amount*-1)|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% endif %}
</li>
{% endfor %}
</ol>
{% endif %}
</li>
{% endfor %}
</ol>
{% include 'v2.emails.footer-html' %}

View File

@ -1,16 +0,0 @@
{% include 'v2.emails.header-text' %}
{{ trans_choice('email.new_journals_header', transformed|length )|raw }}
{% for group in transformed %}
{% set count = group.transactions|length %}
{% if 1 == count %}{% set journal = group.transactions[0] %}
- {{ journal.description }}, {% if journal.type == 'deposit' %}{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}{% if null != journal.foreign_amount*-1 %} ({{ formatAmountBySymbol(journal.foreign_amount|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}){% endif %}{% elseif journal.type == 'transfer' %}{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}{% if null != journal.foreign_amount %} ({{ formatAmountBySymbol(journal.foreign_amount|floatval*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}){% endif %}{% else %}{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}{% if null != journal.foreign_amount %} ({{ formatAmountBySymbol(journal.foreign_amount|floatval*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}){% endif %}{% endif %}
{% else %}- {{ group.group_title }}
{% for journal in group.transactions %}-- {{ journal.description }}, {% if journal.type == 'deposit' %}{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}{% if null != journal.foreign_amount*-1 %} ({{ formatAmountBySymbol(journal.foreign_amount|floatval, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}){% endif %}{% elseif journal.type == 'transfer' %}{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}{% if null != journal.foreign_amount %} ({{ formatAmountBySymbol(journal.foreign_amount|floatval*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}){% endif %}{% else %}{{ formatAmountBySymbol((journal.amount*-1)|floatval, journal.currency_symbol, journal.currency_decimal_places, false) }}{% if null != journal.foreign_amount %} ({{ formatAmountBySymbol(journal.foreign_amount|floatval*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}){% endif %}{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% include 'v2.emails.footer-text' %}

View File

@ -1,17 +0,0 @@
{% include 'v2.emails.header-html' %}
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.email_change_body_to_old')|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{ trans('email.email_change_ignore') }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{trans('email.email_change_old_strong', { email: oldEmail })|raw }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{trans('email.email_change_new', { email: newEmail }) }}
</p>
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
{{trans('email.email_change_undo_link')}} <a href="{{ uri }}">{{ uri }}</a>
</p>
{% include 'v2.emails.footer-html' %}

View File

@ -3,10 +3,8 @@
{{ Breadcrumbs.render }}
{% endblock %}
{% block content %}
<!-- Small boxes (Stat box) -->
<!-- Main row -->
<div id="no-page">Hello, I am empty page.</div>
<div id="transactions_index"></div>
<!-- /.row (main row) -->
{% endblock %}
@ -15,5 +13,5 @@
{% endblock %}
{% block scripts %}
<script src="v2/js/empty.js" nonce="{{ JS_NONCE }}"></script>
<script src="v2/js/transactions/index.js" nonce="{{ JS_NONCE }}"></script>
{% endblock %}