Current File : /home/tradevaly/public_html/app/Notifications/User/Subscription/SubscriptionPaidInvoice.php
<?php

namespace App\Notifications\User\Subscription;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class SubscriptionPaidInvoice extends Notification
{
    use Queueable;
    public $data;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($data)
    {
        $this->data = $data;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
     return (new MailMessage)
      ->subject('Payment Confirmation')
    ->greeting('Hello ' . $this->data->name)
    ->line('Thank you for your payment and choosing our subscription service! 🎉')
    ->line('We are pleased to confirm that your payment for the Premium Membership subscription has been received.')
    ->line('Invoice Date: ' . now()->toFormattedDateString())
    ->line('Subscription Plan: Premium Membership')
    ->line('Subscription Period: ' . $this->data->start->toFormattedDateString() . ' to ' . $this->data->end->toFormattedDateString())
    ->line('Amount Paid: BDT' . $this->data->amount)
    ->line('Package: ' . $this->data->package)
    ->line('Payment Status: Paid')
    ->action('Download Invoice', route('user.subscription.invoice',$this->data->id))
    ->action('Download Money Receipt', route('user.subscription.money_receipt',$this->data->id))
    ->line('If you have any questions or need further assistance, please feel free to reach out to our support team.')
    ->line('We appreciate your continued support and look forward to providing you with a great experience at Tradevaly!');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}