芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Notifications/ProposalSigned.php
proposal = $proposal; $this->company = $this->proposal->company; $this->emailSetting = EmailNotificationSetting::where('company_id', $this->company->id)->where('slug', 'lead-notification')->first(); } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { $via = ['database']; if ($notifiable->email_notifications && $this->emailSetting->send_email == 'yes' && $notifiable->email != '') { array_push($via, 'mail'); } return $via; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return MailMessage */ public function toMail($notifiable): MailMessage { $url = route('front.proposal', $this->proposal->hash); $url = getDomainSpecificUrl($url, $this->company); if ($this->proposal->status == 'accepted') { return parent::build() ->subject(__('email.proposalSigned.subject')) ->greeting(__('email.hello') . ' ' . mb_ucwords($notifiable->name) . '!') ->line(__('app.status') . ' : ' . mb_ucwords($this->proposal->status)) ->action(__('app.view') . ' ' . __('app.proposal'), $url) ->line(__('email.thankyouNote')); } return parent::build() ->subject(__('email.proposalRejected.subject')) ->greeting(__('email.hello') . ' ' . mb_ucwords($notifiable->name) . '!') ->line(__('email.proposalRejected.rejected') . ' : ' . $this->proposal->client_comment) ->line(__('app.status') . ': ' . mb_ucwords($this->proposal->status)) ->action(__('app.view') . ' ' . __('app.proposal'), $url) ->line(__('email.thankyouNote')); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ //phpcs:ignore public function toArray($notifiable) { return $this->proposal->toArray(); } }