Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

pixelfed/pixelfed

6813 stars
3 code files
View pixelfed/pixelfed on GitHub

app/Mail/ContactAdmin.php

Open in GitHub
use 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 GitHub
use 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));
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.