Skip to content

Commit

Permalink
fix: allow disabling greeting from email blade template
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Sep 29, 2023
1 parent c4901f7 commit 499f203
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 0 additions & 2 deletions framework/core/src/Forum/ForumServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ public function boot(Container $container, Dispatcher $events, Factory $view): v
'translator' => $container->make(TranslatorInterface::class),
'settings' => $container->make(SettingsRepositoryInterface::class),
'formatter' => $container->make(Formatter::class),
'greeting' => true,
'signofff' => true
]);

$events->listen(
Expand Down
16 changes: 8 additions & 8 deletions framework/core/views/email/html/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@
</div>

<div class="content">
@if(isset($greeting) && $greeting !== false)
<div class="greeting">
<p>{!! $translator->trans('core.email.greeting', ['displayName' => $username]) !!}</p>
</div>
@if(!isset($greeting) || $greeting !== false)
<div class="greeting">
<p>{!! $translator->trans('core.email.greeting', ['displayName' => $username]) !!}</p>
</div>
@endif
<div class="main-content">
@yield('content')
</div>
@if(isset($signoff) && $signoff !== false)
<div class="signoff">
<p>{!! $translator->trans('core.email.signoff', ['forumTitle' => $settings->get('forum_title')]) !!}</p>
</div>
@if(!isset($signoff) || $signoff !== false)
<div class="signoff">
<p>{!! $translator->trans('core.email.signoff', ['forumTitle' => $settings->get('forum_title')]) !!}</p>
</div>
@endif
</div>

Expand Down
4 changes: 2 additions & 2 deletions framework/core/views/email/plain/base.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@yield('header')

@if(isset($greeting) && $greeting !== false)
@if(!isset($greeting) || $greeting !== false)
{{ $translator->trans('core.email.greeting', ['displayName' => $username]) }}
@endif

@yield('content')

@if(isset($signoff) && $signoff !== false)
@if(!isset($signoff) || $signoff !== false)
- {{ $translator->trans('core.email.signoff', ['forumTitle' => $settings->get('forum_title')]) }} -
@endif

Expand Down

0 comments on commit 499f203

Please sign in to comment.