param = $param;
}
public function build()
{
try {
$params = $this->param;
$propertyService = App::make("App\Core\Service\OfferService");
$requestParams = [
'offer_id' => fillOnUndefined($params, 'offer_id'),
'property_id' => fillOnUndefined($params, 'property_id'),
];
$offerDetail = $propertyService->findOffer($requestParams);
$offerDetail = fillOnUndefined($offerDetail, 'data');
app('translator')->setLocale($offerDetail["language"]);
$mailSenderAddress = Config::get('app.mailSenderAddress');
$mailParams['to'] = [];
$mailParams['to'] = $offerDetail['create_user']['email'];
$mailParams['bcc'] = [];
$mailParams['bcc'][] = Config::get('app.logMailAddress');
$mailParams['property_name'] = $offerDetail['property']['name'];
$mailParams['url'] = Config::get('app.client_server').'/offer/'.$offerDetail['offer_code'];
$mailParams['logo'] = Config::get('app.webUrl').'/assets/img/logo/mini-logo.png';
if(isset($offerDetail['property_brand']['logoUrl'])) {
$mailParams['logo'] = $offerDetail['property_brand']['logoUrl'];
}
$description = [];
//$description[] = 'Misafir, '.$offerDetail['ticket_code'].' kodlu teklifi onaylamıştır.';
$description[] = __('api-mailing-offer_preconfirm_property_mail-description-one', ['code' => $offerDetail['ticket_code']]);
//$description[] = 'Teklif türü otel onaylı olduğu için, tesis onayı beklenmektedir. Tesis onayını Extranetwork üzerinden verebilirsiniz.';
$description[] = __('api-mailing-offer_preconfirm_property_mail-description-two');
$description = implode('
', $description);
/*echo view('emails.offerPreConfirmPropertyMail', compact('mailParams', 'description'));
die();*/
return $this->from($mailSenderAddress, 'Extranetwork - ' . $mailParams['property_name'])
->view('emails.offerPreConfirmPropertyMail', compact('mailParams', 'description'))
->to($mailParams['to'])
->bcc($mailParams['bcc'])
//->subject($offerDetail['ticket_code'].' Kodlu Teklif Misafir Onayı')
->subject(__('api-mailing-offer_preconfirm_property_mail-title', ['code' => $offerDetail['ticket_code']]))
->with(['message' => $this]);
} catch (Exception $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error($message);
return output(['status' => -1, 'message' => $e->getMessage()]);
}
}
}