简体   繁体   English

单击邮件链接时如何在链接中返回邮件并重定向到另一个页面

[英]how to return mail in link and redirect to another page when clicking the mail link

<?php

namespace App\Mail;

use Modules\HR\Entities\Application;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class ApplicationHandover extends Mailable
{
    use Queueable, SerializesModels;

    public $application;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(Application $application)
    {
        $this->application = $application->applicant;
        //
        // dd($application->applicant);
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
    
        return $this->view('hr::application.application-handover-request');
        
    }
}

return view file:返回视图文件:

<p>Hi {{$application}} </p>

After return view file and I'm getting this type mail:返回视图文件后,我收到这种类型的邮件:

Hi {"id":32,"name":"Aryan Goel","email":"aryan@example.com","phone":null,"linkedin":"https://","course":null,"graduation_year":null,"college":"GEU","created_at":"2021-08-11T23:23:08.000000Z","updated_at":"2021-08-11T23:23:08.000000Z","hr_university_id":null}嗨 {"id":32,"name":"Aryan Goel","email":"aryan@example.com","phone":null,"linkedin":"https://","course": null,“ Graduation_Year”:Z37A6259CC0C1DAE29999A7866489DFF0BDZ,“ COLLACE,” COLLACE “hr_university_id”:空}

I want to get this message in link.我想在链接中获取此消息。 When click the link then open new route(hit the new route) and get this message in view.单击链接时,然后打开新路线(点击新路线)并查看此消息。

if you use Hi {{$application}} print all data in variable $application , because the $application is an array.如果您使用Hi {{$application}}打印变量$application中的所有数据,因为$application是一个数组。 you should use {{ $application['name'] }} print name.您应该使用{{ $application['name'] }}打印名称。

and for link use {{ $application['linkedin'] }}对于链接使用{{ $application['linkedin'] }}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM