2019-09-03 04:43:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
2022-09-29 02:16:08 +00:00
|
|
|
use Illuminate\Support\Facades\Config;
|
2019-09-03 04:43:59 +00:00
|
|
|
|
2022-08-12 04:53:06 +00:00
|
|
|
use App\Models\{Site,User,UserOauth};
|
2019-09-03 04:43:59 +00:00
|
|
|
|
|
|
|
class SocialLink extends Mailable
|
|
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
2021-09-29 06:20:22 +00:00
|
|
|
public string $token;
|
2022-08-12 04:53:06 +00:00
|
|
|
public Site $site;
|
|
|
|
public ?User $user;
|
2019-09-03 04:43:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
2022-08-12 04:53:06 +00:00
|
|
|
* @param UserOauth $o
|
2019-09-03 04:43:59 +00:00
|
|
|
*/
|
2022-08-12 04:53:06 +00:00
|
|
|
public function __construct(UserOauth $o)
|
2019-09-03 04:43:59 +00:00
|
|
|
{
|
2022-08-12 04:53:06 +00:00
|
|
|
$this->site = $o->site;
|
2019-09-03 04:43:59 +00:00
|
|
|
$this->token = $o->link_token;
|
2022-08-12 04:53:06 +00:00
|
|
|
$this->user = $o->user;
|
2019-09-03 04:43:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2022-09-29 02:16:08 +00:00
|
|
|
Config::set('site',$this->site);
|
|
|
|
|
2019-09-03 04:43:59 +00:00
|
|
|
return $this
|
2024-08-03 00:06:25 +00:00
|
|
|
->markdown('mail.system.social_link')
|
2019-09-03 04:43:59 +00:00
|
|
|
->subject('Link your Account')
|
2020-01-21 09:59:10 +00:00
|
|
|
->with([
|
2022-08-12 04:53:06 +00:00
|
|
|
'site'=>$this->site,
|
|
|
|
]);
|
2019-09-03 04:43:59 +00:00
|
|
|
}
|
|
|
|
}
|