sammyjo20/wagonwheel

此包已被废弃,不再维护。未建议替代包。

为用户提供您的Laravel邮件的在线版本。

资助包维护!
Sammyjo20

2.0.1 2021-02-15 17:12 UTC

This package is auto-updated.

Last update: 2022-08-06 23:11:14 UTC


README

感谢大家下载Wagonwheel,但是我将正式放弃这个项目。

Wagonwheel

这是一个与Ryan Chandler合作的 项目。请考虑支持他,因为他为这个包付出了很多努力!

通过买我一杯咖啡来支持本包的维护。

Wagonwheel

为用户提供您的Laravel邮件的在线版本。

Latest Stable Version Total Downloads License

  • 使用Laravel内置的临时签名URL来创建在线版本的URL。这意味着它由您的应用加密密钥保护,同时也使得猜测变得困难。

  • 高度可定制。

  • 易于安装。

  • 支持Laravel 8

安装

  1. 使用以下命令使用composer安装Wagonwheel
composer require sammyjo20/wagonwheel
  1. 发布迁移
php artisan vendor:publish --tag=wagonwheel-migrations
  1. 运行迁移
php artisan migrate
  1. 将 "SaveForOnlineViewing" 特性添加到您的 任何 Mailable。
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Sammyjo20\Wagonwheel\Concerns\SaveForOnlineViewing;

class BookingConfirmed extends Mailable
{
    use Queueable, SerializesModels, SaveForOnlineViewing;
    
    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('Booking Confirmed 🎉')
            ->markdown('emails.bookings.confirmed');
    }
}

配置

如果您想自定义Wagonwheel的工作方式,请运行以下命令来发布Wagonwheel的配置文件。

php artisan vendor:publish --tag=wagonwheel-config

component_placement - 此配置变量定义了横幅是否应该在电子邮件内容的开始处或结束处渲染。可用的值是 startend

message_expires_in_days - 此配置变量定义了Wagonwheel应将电子邮件的在线版本保留多少天。如果您希望电子邮件的在线版本永不过期,请将其设置为0。默认值为30天

自定义

如果您想自定义电子邮件内横幅的外观,只需使用以下命令发布Wagonwheel的视图。

php artisan vendor:publish --tag=wagonwheel-views

测试

运行所有测试

composer test

运行特定测试

composer test-f [name of test method]

感谢

  • Ryan Chandler (@ryangjchandler) 在一些优秀的代码改进和使Wagonwheel变得更好方面提供了巨大帮助!
  • Gareth Thompson (@cssgareth) 帮助想出一个酷炫的名字!