param = $param; } public function build() { try { $params = $this->param; $mailSenderAddress = Config::get('app.mailSenderAddress'); $propertyService = App::make('App\Core\Service\PropertyService'); $requestData = [ 'criteria' => [ ['field' => 'id', 'condition' => '=', 'value' => $params['propertyId']] ], 'with' => ['propertyUser.user'], 'firstRow' => true ]; $propertyDetail = $propertyService->select($requestData); $propertyUser = []; if($propertyDetail['status'] == 'success' && !empty($propertyDetail['data'])) { $propertyUser = collect($propertyDetail['data']['property_user'])->where('status',1)->pluck('user.email')->toArray(); } /*echo view('emails.channelManagerNotificationMail', compact('params')); die();*/ return $this->from($mailSenderAddress, 'Extranetwork') ->view('emails.channelManagerNotificationMail', compact('params')) ->to('channel@extranetwork.com', 'Extranetwork Channel') ->bcc($propertyUser) ->subject('Channel Update Error: ' . $params['propertyName']); } catch (Exception $e) { $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage(); Log::error($message); return output(['status' => -1, 'message' => $e->getMessage()]); } } }