ctml It's all theoretical and in my head at the moment, but my general plan is move to more of a Laravel blade & partials situation. At the moment, each template creates the full html
in it's own right, this makes updating say the email header or footer clumbersome for example.
With a tiered level of partial templates, it will allow pre-defined elements to be pulled in to any specific template with ease.
For example, a newPost
template might look something like this:
@extends('pretty-mail-templates::mail.mailhtml')
@section('content')
@include('pretty-mail-templates::mail.partials.greeting')
<div>
@include('pretty-mail-templates::mail.partials.userLink', ['username' => $blueprint->post->user->username]) posted in a discussion you're following:
@include('pretty-mail-templates::mail.partials.discussionLink', ['id' => $blueprint->post->discussion_id, 'title' => $blueprint->post->discussion->title, 'number' => $blueprint->post->number]).
</div>
@include('pretty-mail-templates::mail.partials.contentPreview', ['post' => $blueprint->post])
@endsection
The bulk of the template would be held in pretty-mail-templates::mail.mailhtml
- this is where your styles, logo, etc, etc are defined, then each template adds to the content
element to produce the end result.
Like I said, I'm still thinking it all over at the moment, but will make a start on this soon 🙂