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