芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Notifications/NewOrder.php
order = $order; $this->company = $this->order->company; $this->emailSetting = EmailNotificationSetting::where('company_id', $this->company->id)->where('slug', 'order-createupdate-notification')->first(); } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { $via = ($this->emailSetting->send_email == 'yes' && $notifiable->email_notifications && $notifiable->email != '') ? ['mail', 'database'] : ['database']; if ($this->emailSetting->send_push == 'yes') { array_push($via, OneSignalChannel::class); } return $via; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage|void */ public function toMail($notifiable) { if ($this->order) { $url = route('orders.show', $this->order->id); $url = getDomainSpecificUrl($url, $this->company); $subject = (!in_array('client', user_roles()) ? __('email.orders.subject') : __('email.order.subject')); return parent::build() ->subject($subject . ' - ' . config('app.name') . '.') ->greeting(__('email.hello') . ' ' . $notifiable->name . '!') ->line(__('email.order.text')) ->action(__('email.order.action'), $url) ->line(__('email.thankyouNote')); } } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ //phpcs:ignore public function toArray($notifiable) { return [ 'id' => $this->order->id, 'order_number' => $this->order->order_number ]; } }