D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
tattooscyy
/
test
/
app
/
Mail
/
Filename :
PromotionEmailSender.php
back
Copy
<?php namespace App\Mail; use App\PromotionEmail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; class PromotionEmailSender extends Mailable { use Queueable, SerializesModels; /** * The order instance. * * @var User */ public $promotion_email; public $obj; /** * Создать новый экземпляр сообщения. * * @return void */ public function __construct(PromotionEmail $promotion_email, $obj) { $this->promotion_email = $promotion_email; $this->obj = $obj; } /** * Построить сообщение. * * @return $this */ public function build() { $lang = app()->getLocale(); if($lang == 'ru'){ $view_email = 'sender_ru'; }elseif($lang == 'fr'){ $view_email = 'sender_fr'; }else{ $view_email = 'sender_en'; } return $this->from(env('MAIL_FROM_ADDRESS'), env('MAIL_FROM_NAME'))->view('emails.'.$view_email)->subject($this->obj->thema)->with('promotion_email', $this->promotion_email)->with('obj', $this->obj); } }