Fewo/ PDFs / Mails v3
This commit is contained in:
parent
7abfe3f700
commit
e537e47a82
44 changed files with 2112 additions and 527 deletions
68
app/Mail/MailSendFeWoInvoice.php
Normal file
68
app/Mail/MailSendFeWoInvoice.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?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 MailSendFeWoInvoice extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
protected $travel_user_booking_fewo;
|
||||
protected $notice;
|
||||
public $subject;
|
||||
|
||||
|
||||
public function __construct(TravelUserBookingFewo $travel_user_booking_fewo, $notice)
|
||||
{
|
||||
$this->travel_user_booking_fewo = $travel_user_booking_fewo;
|
||||
$this->notice = $notice;
|
||||
$this->subject = __('STERN TOURS Mietbestätigung 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' => Storage::disk('public')->path("pdf/Stern-Tours-Mietbedingungen.pdf"),
|
||||
'name' => 'Stern-Tours-Mietbedingungen.pdf',
|
||||
'mine' => 'application/pdf',
|
||||
);
|
||||
|
||||
$file2 = array(
|
||||
'path' => $this->travel_user_booking_fewo->getInvoicePathFile(),
|
||||
'name' => 'Stern-Tours-'.$this->travel_user_booking_fewo->getInvoiceFileName(),
|
||||
'mine' => 'application/pdf',
|
||||
);
|
||||
|
||||
return $this->view('emails.invoice')
|
||||
->with([
|
||||
'salutation' => $salutation,
|
||||
'copy1line' => "herzlichen Dank für Ihre Online-Buchung vom ".$this->travel_user_booking_fewo->booking_date.", hiermit bestätigen wir verbindlich Ihre Anmietung wie folgt:",
|
||||
'copy2line' => '',
|
||||
'notice' => $this->notice,
|
||||
'greetings' => __('Best regards'),
|
||||
'model' => $this->travel_user_booking_fewo,
|
||||
])
|
||||
->attach($file1['path'], [
|
||||
'as' => $file1['name'],
|
||||
'mime' => $file1['mine'],
|
||||
])
|
||||
->attach($file2['path'], [
|
||||
'as' => $file2['name'],
|
||||
'mime' => $file2['mine'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue