osb/app/Mail/SocialLink.php

48 lines
807 B
PHP
Raw Normal View History

2019-09-03 04:43:59 +00:00
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Config;
2019-09-03 04:43:59 +00:00
use App\Models\{Site,User,UserOauth};
2019-09-03 04:43:59 +00:00
class SocialLink extends Mailable
{
use Queueable, SerializesModels;
public string $token;
public Site $site;
public ?User $user;
2019-09-03 04:43:59 +00:00
/**
* Create a new message instance.
*
* @param UserOauth $o
2019-09-03 04:43:59 +00:00
*/
public function __construct(UserOauth $o)
2019-09-03 04:43:59 +00:00
{
$this->site = $o->site;
2019-09-03 04:43:59 +00:00
$this->token = $o->link_token;
$this->user = $o->user;
2019-09-03 04:43:59 +00:00
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
Config::set('site',$this->site);
2019-09-03 04:43:59 +00:00
return $this
->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([
'site'=>$this->site,
]);
2019-09-03 04:43:59 +00:00
}
}