gpt4 book ai didi

php - Laravel 5.4 邮件消息如何编辑页眉和页脚

转载 作者:可可西里 更新时间:2023-11-01 12:46:42 28 4
gpt4 key购买 nike

您好,我正在尝试在我的 Laravel 应用程序中使用 MailMessage 函数。我的问题很简单。从应用程序接收电子邮件时如何编辑页眉和页脚?这是下图。

enter image description here

我想将标题 Laravel 从我的应用程序名称和带有 Hello $user->name 的 Hello 和 Regards 更改为我的应用程序名称,下面的页脚也更改为应用程序名称。

enter image description here

我试图改变`

resources/views/vendor/mail/markdown/message.blade.php

收件人:

@component('mail::layout')
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => config('app.url')])
CCTV App
@endcomponent
@endslot

{{-- Body --}}
{{ $slot }}

{{-- Subcopy --}}
@isset($subcopy)
@slot('subcopy')
@component('mail::subcopy')
CCTV Team
@endcomponent
@endslot
@endisset

{{-- Footer --}}
@slot('footer')
@component('mail::footer')
© {{ date('Y') }} CCV3. All rights reserved.
@endcomponent
@endslot
@endcomponent

但是当我发送重设密码请求时不工作如果有人能帮助我,我将不胜感激。提前致谢。

`

最佳答案

I want to change the header Laravel from my App name and the Hello with a Hello $user->name and the Regards, with my App name also and the footer below to the App name also

Mailable Markdown 默认有 config('app.name') 从你的 .env 文件中选择 APP_NAME。因此,通过修改 APP_NAME 将影响您的 Markdown 模板。

或者如果您手动修改它,请在您的终端上运行以下命令
php artisan vendor:publish --tag=laravel-mail 并转到 resources/views/vendor/mail/html/message.blade.php 并修改标题和页脚插槽。

要将 Hello 更改为 Hello {user_name},有一个名为 greeting() 的 Markdown 包含 Hello! 的方法,您可以随意更改它。

问候 在您的终端上运行此命令
php artisan vendor:publish --tag=laravel-notifications 并转到 resources/views/vendor/notifications/email.blade.php 并修改 问候任何你想要的。

要了解更多详情,请查看 customizing markdown email .

关于php - Laravel 5.4 邮件消息如何编辑页眉和页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45929579/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com