New contact form with friendlycaptcha
This commit is contained in:
45
app/Mail/ContactFormSubmitted.php
Normal file
45
app/Mail/ContactFormSubmitted.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class ContactFormSubmitted extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $data;
|
||||
public $attachments_files;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($data, $attachments_files = [])
|
||||
{
|
||||
$this->data = $data;
|
||||
$this->attachments_files = $attachments_files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$email = $this->view('emails.contact_submitted')
|
||||
->subject('Nieuw contactformulier bericht van NH Gooi')
|
||||
->replyTo($this->data['email'], $this->data['name']);
|
||||
|
||||
if (isset($this->attachments_files['image'])) {
|
||||
$email->attach($this->attachments_files['image']);
|
||||
}
|
||||
|
||||
return $email;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user