init
All checks were successful
Deploy to Production / deploy (push) Successful in 14s

This commit is contained in:
珂珂
2024-11-15 11:44:35 +08:00
parent d3923edd75
commit d8ddb4d489
15 changed files with 412 additions and 187 deletions

37
app/Mail/HelloMail.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class HelloMail extends Mailable
{
use Queueable, SerializesModels;
public function __construct(protected $name)
{
//
}
public function envelope(): Envelope
{
return new Envelope(
subject: '邮件功能测试',
);
}
public function content(): Content
{
return new Content(htmlString: "<p>您好,{$this->name}</p><p>这是一封测试邮件,请勿回复。<br><br>祝,工作顺利!</p>");
}
public function attachments(): array
{
return [];
}
}

View File

@@ -0,0 +1,53 @@
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class HelloNotification extends Notification
{
use Queueable;
public function __construct(protected $name)
{
//
}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage())
->subject("消息测试")
->greeting("您好,{$this->name}")
->line("这是一条测试邮件")
->line("=====")
->salutation("祝,工作愉快!");
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
//
];
}
}