我在使用時遇到郵件問題queue。如果我使用 Mail send(),一切正常。控制器:Mail::to($order_data->client_email) ->cc([ ['email' => $order_data->seller->email], ['email' => auth()->user()->email] ]) ->queue(new SendOrderConfirmation($order_data));可郵寄的:class SendOrderConfirmation extends Mailable{ use Queueable, SerializesModels; /** * Defines a public variable $order_data that we will be using to pass in parameters from our controller. */ public $order_data; /** * Create a new message instance. */ public function __construct($data) { // set email data $this->order_data = $data; // Set Reply to address // Basically, the name and email from who's sending this email $this->replyto(auth()->user()->email, auth()->user()->name); // Set from $this->from(auth()->user()->email, auth()->user()->name); // set email subject $this->subject('Laminar - Confirma??o da Encomenda N.o '.$this->order_data->order_nr); } /** * Build the message. * * @return $this */ public function build() { return $this->view('send_emails.Lamimail.SendOrderConfirmation'); }}如果我使用隊列()觸發電子郵件,我會收到有關望遠鏡作業的錯誤消息:Trying to get property 'name' of non-object (View: path\resources\views\send_emails\Lamimail\SendOrderConfirmation.blade.php)但是,在郵件視圖中,名稱是一個簡單的auth()->user()->name.有誰知道我在隊列中失蹤了?
- 2 回答
- 0 關注
- 151 瀏覽
添加回答
舉報
0/150
提交
取消