Teilnehmer extra, Emails Anfragen Order

This commit is contained in:
Kevin Adametz 2021-09-15 19:11:38 +02:00
parent a718baf971
commit 5e3bd3a1ba
19 changed files with 174 additions and 48 deletions

View file

@ -19,6 +19,7 @@ class Placeholder
'program' => '#Programm#',
'start_date' => '#Anreisedatum#',
'end_date' => '#Abreisedatum#',
'participants' => '#Teilnehmer#',
'booking_date' => '#Buchungsdatum#',
'airline' => '#Airline#'
];
@ -54,6 +55,26 @@ class Placeholder
$end_date = $booking->getEndDateFormat();
$booking_date = $booking->getBookingDateFormat();
$airline = $booking->airline ? $booking->airline->name_full : '-';
$participants = "Teilnehmer:<br>";
//first
if($booking->participant_firstname){
$participants .= $booking->participant_salutation_id ? \App\Services\Model::getSalutationById($booking->participant_salutation_id)." " : '';
$participants .= $booking->participant_firstname." ".$booking->participant_name;
$participants .= $booking->participant_birthdate ? ' | '._format_date($booking->participant_birthdate) : '';
$participants .= $booking->travel_nationality ? ' | '.$booking->travel_nationality->name : '';
$participants .= '<br>';
}
if($booking->participants->count()){
foreach($booking->participants as $participant){
$participants .= $participant->salutation ? $participant->salutation->name." " : '';
$participants .= $participant->participant_firstname." ".$participant->participant_name;
$participants .= $participant->participant_birthdate ? ' | '._format_date($participant->participant_birthdate) : '';
$participants .= $participant->travel_nationality ? ' | '.$participant->travel_nationality->name : '';
$participants .= $participant->participant_child ? ' | Kind' : '';
$participants .= '<br>';
}
}
$search = [];
$replace = [];
@ -79,6 +100,7 @@ class Placeholder
$start_date = $booking_fewo->from_date;
$end_date = $booking_fewo->to_date;
$booking_date = $booking_fewo->booking_date;
$participants = "";
$airline = "";
$search = [];
$replace = [];
@ -103,10 +125,23 @@ class Placeholder
$program = "";
$salutation = $lead->customer->salutation_id == 1 ? 'Herr' : 'Frau';
$start_date = $lead->travelperiod_start ? _format_date($lead->travelperiod_start) : '';
$end_date = $lead->travelperiod_end ? _format_date($lead->travelperiod_end) : '';;
$booking_date = $lead->request_date ? _format_date($lead->request_date) : '';;
$end_date = $lead->travelperiod_end ? _format_date($lead->travelperiod_end) : '';
$booking_date = $lead->request_date ? _format_date($lead->request_date) : '';
$participants = "";
$airline = "";
if($lead->lead_participants->count()){
$participants = "Teilnehmer:<br>";
foreach($lead->lead_participants as $participant){
$participants .= $participant->salutation ? $participant->salutation->name." " : '';
$participants .= $participant->participant_firstname." ".$participant->participant_name;
$participants .= $participant->participant_birthdate ? ' | '._format_date($participant->participant_birthdate) : '';
//$participants .= $participant->participant_child ? ' | Kind' : ' | Erwachsener';
//$participants .= $participant->travel_nationality ? ' | '.$participant->travel_nationality->name : '';
$participants .= '<br>';
}
}
$search = [];
$replace = [];