mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-21 23:32:39 +00:00
Add AdminMessageResponse
This commit is contained in:
parent
11da5605b2
commit
1173e63a45
2 changed files with 95 additions and 0 deletions
71
app/Mail/AdminMessageResponse.php
Normal file
71
app/Mail/AdminMessageResponse.php
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Contact;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Mail\Mailables\Headers;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class AdminMessageResponse extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct(
|
||||
public Contact $contact,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Get the message headers.
|
||||
*/
|
||||
public function headers(): Headers
|
||||
{
|
||||
$mid = $this->contact->getMessageId();
|
||||
|
||||
return new Headers(
|
||||
messageId: $mid,
|
||||
text: [
|
||||
'X-Entity-Ref-ID' => $mid,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: ucfirst(strtolower(config('pixelfed.domain.app'))).' Contact Form Response [Ticket #'.$this->contact->id.']',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
markdown: 'emails.contact.admin-response',
|
||||
with: [
|
||||
'url' => $this->contact->userResponseUrl(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
24
resources/views/emails/contact/admin-response.blade.php
Normal file
24
resources/views/emails/contact/admin-response.blade.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<x-mail::message>
|
||||
Hello **@{{$contact->user->username}}**,
|
||||
|
||||
You contacted the admin team of {{config('pixelfed.domain.app')}} with the following inquiry:
|
||||
|
||||
<x-mail::panel>
|
||||
<i>{{str_limit($contact->message, 80)}}</i>
|
||||
</x-mail::panel>
|
||||
|
||||
<x-mail::button :url="$url" color="primary">
|
||||
View Admin Response
|
||||
</x-mail::button>
|
||||
|
||||
<small>
|
||||
or copy and paste the following url: <a href="{{$url}}">{{$url}}</a>
|
||||
</small>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<small>
|
||||
Thanks,<br>
|
||||
The {{ ucfirst(config('pixelfed.domain.app')) }} Admin Team
|
||||
</small>
|
||||
</x-mail::message>
|
Loading…
Reference in a new issue