芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Notifications/InvoicePaymentReceived.php
payment = $payment; $this->company = $this->payment->company; $this->invoiceSetting = $this->company->invoiceSetting; $this->emailSetting = EmailNotificationSetting::where('company_id', $this->company->id)->where('slug', 'invoice-createupdate-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 */ public function toMail($notifiable) { $invoice = Invoice::findOrFail($this->payment->invoice_id); if ($invoice->order_id != null) { $number = __('app.order') . '#' . $invoice->order_id; $message = __('email.invoices.paymentReceivedForOrder'); $url = route('orders.show', $invoice->order_id); $actionBtn = __('email.orders.action'); } else { $number = $invoice->invoice_number; $message = __('email.invoices.paymentReceivedForInvoice'); $url = route('invoices.show', $invoice->id); $actionBtn = __('email.invoices.action'); } $url = getDomainSpecificUrl($url, $this->company); return parent::build() ->subject(__('email.invoices.paymentReceived') . ' - ' . config('app.name')) ->greeting(__('email.hello') . ' ' . mb_ucwords($notifiable->name) . __('!')) ->line($message . ':- ') ->line($number) ->action($actionBtn, $url) ->line(__('email.thankyouNote')); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ //phpcs:ignore public function toArray($notifiable) { $invoice = Invoice::find($this->payment->invoice_id); if ($invoice) { return [ 'id' => $invoice->id, 'invoice_number' => $invoice->invoice_number ]; } return ''; } }