first commit
This commit is contained in:
46
app/Mail/CustomMailer.php
Normal file
46
app/Mail/CustomMailer.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CustomMailer extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $formData;
|
||||
|
||||
public function __construct($formData)
|
||||
{
|
||||
$this->formData = $formData;
|
||||
}
|
||||
|
||||
public function enquiryform()
|
||||
{
|
||||
$viewPath = 'accessskills.emails.enquiry-submitted';
|
||||
|
||||
if (view()->exists($viewPath)) {
|
||||
return $this->subject('Received a new online enquiry from our website.')
|
||||
->markdown($viewPath, $this->formData);
|
||||
} else {
|
||||
return $this->subject('Received a new online enquiry from our website.')
|
||||
->view('emails.enquiry-submitted', $this->formData);
|
||||
}
|
||||
}
|
||||
|
||||
public function enquiryresponse()
|
||||
{
|
||||
$viewPath = 'accessskills.emails.enquiry-response';
|
||||
|
||||
if (view()->exists($viewPath)) {
|
||||
return $this->subject('Thank you from ' . env('APP_NAME'))
|
||||
->markdown($viewPath, $this->formData);
|
||||
} else {
|
||||
return $this->subject('Thank you from ' . env('APP_NAME'))
|
||||
->view('emails.enquiry-response', $this->formData);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
54
app/Mail/Registration.php
Normal file
54
app/Mail/Registration.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?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 Registration extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $details;
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($details)
|
||||
{
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: 'Registration',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'ved.email.registration',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user