広告

AWS Laravel ubuntu

Laravel パスワード再発行メール 多言語化

https://qiita.com/usaginooheso/items/9d61361d449a521a5854

$php artisan vendor:publish --tag=laravel-notifications

以上の処理でEメールの確認メールとパスワードリセットのテンプレートが同じファイルを参照してしまいました。

https://www.heart-net.biz/wordpress/aws/email-template/
で書いているようにテンプレートを分けておく必要があります。

/resources/views/vendor/notifications/email.blade.php

@component('mail::message')
{{-- Greeting --}}
@if (! empty($greeting))
# {{ $greeting }}
@else
@if ($level === 'error')
# @lang('Whoops!')
@else
# @lang(__('auth.hello'))
@endif
@endif

{{-- Intro Lines --}}
{{ __('auth.line') }}

{{-- Action Button --}}
@isset($actionText)
<?php
switch ($level) {
case 'success':
case 'error':
$color = $level;
break;
default:
$color = 'primary';
}
?>
@component('mail::button', ['url' => $actionUrl, 'color' => $color])
{{ __('auth.actiontext') }}
@endcomponent
@endisset

{{-- Outro Lines --}}
{{ __('auth.oline1') }}

{{-- Salutation --}}
@if (! empty($salutation))
{{ $salutation }}
@else
@lang(__('auth.regards'))<br>
{{ config('app.name') }}
@endif

{{-- Subcopy --}}
@isset($actionText)
@component('mail::subcopy')
@lang(__('auth.oline2'))<br>
@lang(__('auth.intobrowser'))
[{{ $actionUrl }}]({!! $actionUrl !!})
@endcomponent
@endisset
@endcomponent

Hits: 41

広告

  • この記事を書いた人

higa

システムエンジニアをやっています。 Linux,macOS好き。おもにシステム管理たまに豆柴こてつの話。 最近はスマートホームを推進中。

-AWS, Laravel, ubuntu