<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class ReceiptMail extends Mailable
{
    use Queueable, SerializesModels;
    protected $pdf;
    public $studentnames;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($pdf, $studentnames)
    {
        //
        $this->pdf = $pdf;
        $this->studentnames = $studentnames;
    }

    

    /**
     * Get the message envelope.
     *
     * @return \Illuminate\Mail\Mailables\Envelope
     */
 

    /**
     * Get the message content definition.
     *
     * @return \Illuminate\Mail\Mailables\Content
     */
    public function build()
    {
        //return $this->markdown('emails.dailyreports')
                    //->with('details', $this->details);

        return $this->from(env('MAIL_FROM_ADDRESS'))
               ->subject('St John Ambulance Kenya - Payment Receipt')
               ->markdown('emails.receipt')
               ->attachData($this->pdf->output(), 'PaymentReceipt.pdf');
    }
}
