芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Notifications/EstimateAccepted.php
estimate = $estimate; $this->company = $this->estimate->company; $this->emailSetting = EmailNotificationSetting::where('company_id', $this->company->id)->where('slug', 'estimate-notification')->first(); } /** * Get the notification's delivery channels. * * @return array */ public function via() { $via = []; if ($this->emailSetting->send_slack == 'yes' && $this->company->slackSetting->status == 'active') { array_push($via, 'slack'); } return $via; } public function toSlack($notifiable) { $slack = $notifiable->company->slackSetting; if (count($notifiable->employee) > 0 && (!is_null($notifiable->employee[0]->slack_username) && ($notifiable->employee[0]->slack_username != ''))) { return (new SlackMessage()) ->from(config('app.name')) ->to('@' . $notifiable->employee[0]->slack_username) ->image($slack->slack_logo_url) ->content(__('email.hello') . ' ' . $notifiable->name . $this->estimate->estimate_number .' '. __('email.estimateAccepted.subject')); } return (new SlackMessage()) ->from(config('app.name')) ->image($slack->slack_logo_url) ->content(__('email.hello') . ' ' . $notifiable->name .' '. $this->estimate->estimate_number .' '. __('email.estimateAccepted.subject')); } }