42 lines
847 B
PHP
42 lines
847 B
PHP
<?php
|
|
|
|
namespace Modules\ContactForm\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ContactFormMessage extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
protected $data;
|
|
/**
|
|
* @var
|
|
*/
|
|
private $template;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @param $data
|
|
* @param $template
|
|
*/
|
|
public function __construct($data, $subject, $template)
|
|
{
|
|
$this->data = $data;
|
|
$this->template = $template;
|
|
$this->subject = $subject;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
return $this->subject($this->subject)
|
|
->from($this->data['email'])
|
|
->view($this->template, ['data' => $this->data]);
|
|
}
|
|
}
|