Skip to content

Instantly share code, notes, and snippets.

@tderick
Created August 30, 2022 00:59
Show Gist options
  • Save tderick/a86b8f324147220418369925909c8cb7 to your computer and use it in GitHub Desktop.
Save tderick/a86b8f324147220418369925909c8cb7 to your computer and use it in GitHub Desktop.
The final look of ContactEmail.php
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use App\Models\Contact;
class ContactMail extends Mailable
{
use Queueable, SerializesModels;
public Contact $contact;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(Contact $contact)
{
$this->contact = $contact;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$adminEmail = env('MAIL_FROM_ADDRESS');
return $this->from($adminEmail)->view('emails.contact');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment