0

我使用 laravel 5.4.20,我想让重置密码电子邮件排队。

我稍微定制了重置密码电子邮件(用于更改主题)。

首先我为它创建了通知:

<?php

namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class ResetPassword extends Notification implements ShouldQueue
{
use Queueable;
public $token;

public function __construct($token)
{
    $this->token = $token;
}


public function via($notifiable)
{
    return ['mail'];
}



public function toMail($notifiable)
{
    return (new MailMessage)
        ->subject('its sub')
        ->line('You are receiving this email because we received a password reset request for your account.')
        ->action('Reset Password', url('password/reset', $this->token))
        ->line('If you did not request a password reset, no further action is required.');
}



public function toArray($notifiable)
{
    return [
        //
    ];
}
}

然后我在我的应用程序/用户模型中使用了这个功能

use Notifiable;

public function sendPasswordResetNotification($token)
{
    // Your your own implementation.
    $this->notify(new ResetPasswordNotification($token));
}

电子邮件是正确的,它将发送。但现在我应该怎么做才能让这封电子邮件排队?谢谢你

4

0 回答 0