File: /var/www/vhost/disk-apps/demo.sports-crowd.com/app/Mail/CreatedUserAndCarnetMail.php
<?php
namespace App\Mail;
use App\Core\Parameter\Application\ParameterService;
use App\CorporateIdentity;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class CreatedUserAndCarnetMail extends Mailable
{
use Queueable, SerializesModels;
public $email;
public $password;
private $isNewUser;
private $segmentation;
private $parameterService;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($email, $password, $isNewUser, $segmentation)
{
$this->email = $email;
$this->password = $password;
$this->isNewUser = $isNewUser;
$this->segmentation = $segmentation;
$this->parameterService = new ParameterService();
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$appStoreUrl = $this->parameterService->appStoreUrl();
$playStoreUrl = $this->parameterService->playStoreUrl();
$corporateIdentity = CorporateIdentity::first();
$mail = $this->subject($this->segmentation)->view('mails.createdUserAndCarnet')->with(
[
'isNewUser' => $this->isNewUser,
'email' => $this->email,
'password' => $this->password,
'segmentation' => $this->segmentation,
'appStoreUrl' => $appStoreUrl,
'playStoreUrl' => $playStoreUrl,
'corporateIdentity' => $corporateIdentity
]
);
return $mail;
}
}