-
app/Mail/ContactAdmin.php
Open in GitHubuse Illuminate\Mail\Mailable; use App\Contact; class ContactAdmin extends Mailable { protected $contact; public function __construct(Contact $contact) { $this->contact = $contact; } public function build() { $contact = $this->contact; return $this->markdown('emails.contact.admin')->with(compact('contact')); } }
-
resources/views/emails/contact/admin.blade.php
Open in GitHub@component('mail::message') # New Support Message <br> @if($contact->response_requested) **This user has requested a response from you.** @endif <br> [**{{$contact->user->username}}**]({{$contact->user->url()}}) has sent the following message: @component('mail::panel') {{ $contact->message }} @endcomponent @component('mail::button', ['url' => $contact->adminUrl(), 'color' => 'primary']) View Message @endcomponent @endcomponent
-
app/Jobs/ContactPipeline/ContactPipeline.php
Open in GitHubuse App\Contact; use App\Mail\ContactAdmin; use Mail; class ContactPipeline implements ShouldQueue { protected $contact; public function __construct(Contact $contact) { $this->contact = $contact; } public function handle() { $contact = $this->contact; $email = config('instance.email'); if(config('instance.contact.enabled') == false || $contact->read_at !== null || filter_var($email, FILTER_VALIDATE_EMAIL) == false) { return; } Mail::to($email)->send(new ContactAdmin($contact)); } }