44 lines
		
	
	
		
			1017 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1017 B
		
	
	
	
		
			PHP
		
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Payment;
 | 
						|
 | 
						|
use App\Pdf\PdfRepository;
 | 
						|
use Illuminate\Bus\Queueable;
 | 
						|
use Illuminate\Contracts\Queue\ShouldQueue;
 | 
						|
use Illuminate\Mail\Mailable;
 | 
						|
use Illuminate\Queue\SerializesModels;
 | 
						|
use Illuminate\Support\Str;
 | 
						|
 | 
						|
class PaymentMail extends Mailable
 | 
						|
{
 | 
						|
    use Queueable, SerializesModels;
 | 
						|
    
 | 
						|
    public PdfRepository $repo;
 | 
						|
    public string $filename;
 | 
						|
 | 
						|
    /**
 | 
						|
     * Create a new message instance.
 | 
						|
     *
 | 
						|
     * @return void
 | 
						|
     */
 | 
						|
    public function __construct(PdfRepository $repo, string $filename)
 | 
						|
    {
 | 
						|
        $this->filename = $filename;
 | 
						|
        $this->repo = $repo;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Build the message.
 | 
						|
     *
 | 
						|
     * @return $this
 | 
						|
     */
 | 
						|
    public function build()
 | 
						|
    {
 | 
						|
        $template = Str::snake(class_basename($this->repo));
 | 
						|
        return $this->markdown('mail.payment.'.$template)
 | 
						|
                    ->attach($this->filename)
 | 
						|
                    ->replyTo('kasse@stamm-silva.de')
 | 
						|
                    ->subject($this->repo->getMailSubject().' | DPSG Stamm Silva');
 | 
						|
    }
 | 
						|
}
 |