Fewo/ PDFs / Mails v3
This commit is contained in:
parent
7abfe3f700
commit
e537e47a82
44 changed files with 2112 additions and 527 deletions
57
app/Mail/MailSendFeWoInfo.php
Normal file
57
app/Mail/MailSendFeWoInfo.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\TravelUserBookingFewo;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Storage;
|
||||
|
||||
class MailSendFeWoInfo extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
protected $travel_user_booking_fewo;
|
||||
public $subject;
|
||||
|
||||
|
||||
public function __construct(TravelUserBookingFewo $travel_user_booking_fewo)
|
||||
{
|
||||
$this->travel_user_booking_fewo = $travel_user_booking_fewo;
|
||||
$this->subject = __('STERN TOURS Anreiseinfo FEWO');
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
$salutation = __('Dear customer').",";
|
||||
if($this->travel_user_booking_fewo->travel_user){
|
||||
if($this->travel_user_booking_fewo->travel_user->salutation_id == 1){
|
||||
$salutation = __('Dear Sir')." ".$this->travel_user_booking_fewo->travel_user->last_name.",";
|
||||
}else{
|
||||
$salutation = __('Dear Mrs')." ".$this->travel_user_booking_fewo->travel_user->last_name.",";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$file1 = array(
|
||||
'path' => $this->travel_user_booking_fewo->getTravelInfoPathFile(),
|
||||
'name' => 'Stern-Tours-'.$this->travel_user_booking_fewo->getTravelInfoFileName(),
|
||||
'mine' => 'application/pdf',
|
||||
);
|
||||
|
||||
return $this->view('emails.info')
|
||||
->with([
|
||||
'salutation' => $salutation,
|
||||
'copy1line' => $this->travel_user_booking_fewo->info_mail_text,
|
||||
'copy2line' => "",
|
||||
'greetings' => __('Best regards'),
|
||||
'model' => $this->travel_user_booking_fewo,
|
||||
])
|
||||
->attach($file1['path'], [
|
||||
'as' => $file1['name'],
|
||||
'mime' => $file1['mine'],
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue