In order to customize Laravel email templates, in our case to put custom translation strings, first we need to publish this data by running this command:
php artisan vendor:publish
After that, we can access these file in resources->views->vendor
In this example we will translate subcopy of the email template.
1. open resources->views->vendor->notifications->email.blade.php
2. scroll down to the end of the file and replace this:
@slot('subcopy')
@lang(
"If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\n".
'into your web browser:',
[
'actionText' => $actionText,
]
) <span class="break-all">[{{ $displayableActionUrl }}]({{ $actionUrl }})</span>
@endslot
with this:
@lang('app.subcopy_email',
[
'actionText' => $actionText,
]) <span class="break-all">[{{ $displayableActionUrl }}]({{ $actionUrl }})</span>
@endslot
3. add translation string to resources->lang->en->app.php
'subcopy_email' => 'If you\’re having trouble clicking the :actionText button, copy and paste the URL below\n into your web browser:'