From 1173e63a453a4eea3c86fefda68b027f9ed1c4de Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 10 Oct 2024 01:56:52 -0600 Subject: [PATCH] Add AdminMessageResponse --- app/Mail/AdminMessageResponse.php | 71 +++++++++++++++++++ .../emails/contact/admin-response.blade.php | 24 +++++++ 2 files changed, 95 insertions(+) create mode 100644 app/Mail/AdminMessageResponse.php create mode 100644 resources/views/emails/contact/admin-response.blade.php diff --git a/app/Mail/AdminMessageResponse.php b/app/Mail/AdminMessageResponse.php new file mode 100644 index 000000000..a42dfa14d --- /dev/null +++ b/app/Mail/AdminMessageResponse.php @@ -0,0 +1,71 @@ +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 + */ + public function attachments(): array + { + return []; + } +} diff --git a/resources/views/emails/contact/admin-response.blade.php b/resources/views/emails/contact/admin-response.blade.php new file mode 100644 index 000000000..d04d3218a --- /dev/null +++ b/resources/views/emails/contact/admin-response.blade.php @@ -0,0 +1,24 @@ + +Hello **@{{$contact->user->username}}**, + +You contacted the admin team of {{config('pixelfed.domain.app')}} with the following inquiry: + + +{{str_limit($contact->message, 80)}} + + + + View Admin Response + + + +or copy and paste the following url: {{$url}} + +
+
+
+ +Thanks,
+The {{ ucfirst(config('pixelfed.domain.app')) }} Admin Team +
+