Skip to content

Commit

Permalink
feat: use components for email templating (#4102)
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 authored Nov 2, 2024
1 parent b3491eb commit 5009029
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions views/emails/html/newPost.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@extends('flarum.forum::email.html.notification.base')
<x-mail::html.notification>
<x-slot:body>
{!! $formatter->convert($translator->trans('flarum-subscriptions.email.new_post.html.body', [
'{poster_display_name}' => $blueprint->post->user->display_name,
'{title}' => $blueprint->post->discussion->title,
'{url}' => $url->to('forum')->route('discussion', ['id' => $blueprint->post->discussion_id, 'near' => $blueprint->post->number])
])) !!}
</x-slot:body>

@section('notificationContent')
{!! $formatter->convert($translator->trans('flarum-subscriptions.email.new_post.html.body', [
'{poster_display_name}' => $blueprint->post->user->display_name,
'{title}' => $blueprint->post->discussion->title,
'{url}' => $url->to('forum')->route('discussion', ['id' => $blueprint->post->discussion_id, 'near' => $blueprint->post->number])
])) !!}
@endsection

@section('contentPreview')
{!! $blueprint->post->formatContent() !!}
@endsection
<x-slot:preview>
{!! $blueprint->post->formatContent() !!}
</x-slot:preview>
</x-mail::html.notification>
8 changes: 4 additions & 4 deletions views/emails/plain/newPost.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@extends('flarum.forum::email.plain.notification.base')

@section('content')
<x-mail::plain.notification>
<x-slot:body>
{!! $translator->trans('flarum-subscriptions.email.new_post.plain.body', [
'{poster_display_name}' => $blueprint->post->user->display_name,
'{title}' => $blueprint->post->discussion->title,
'{url}' => $url->to('forum')->route('discussion', ['id' => $blueprint->post->discussion_id, 'near' => $blueprint->post->number]),
'{content}' => $blueprint->post->content
]) !!}
@endsection
</x-slot:body>
</x-mail::plain.notification>

0 comments on commit 5009029

Please sign in to comment.