laravel-mail-editor icon indicating copy to clipboard operation
laravel-mail-editor copied to clipboard

Extending other mail templates

Open robov opened this issue 5 years ago • 4 comments

I see that I cannot extend my mailable from a default design Would be great to have, so the designs are all consistent and dry

@extends('core.customer.layouts.email')

@section('content') <> @endsection

robov avatar May 26 '20 13:05 robov

Hi @robov, would you be able to provide some a more clearer example of this suggestion?

We can maybe get someone to work on it during Hacktoberfest or before then.

ReeceM avatar Sep 21 '20 16:09 ReeceM

From what I understand, you are suggesting extending a template that you have made yourself?

Or extending the templates from MailEclipse

ReeceM avatar Sep 21 '20 16:09 ReeceM

I would like my main templates to be based in code (ie, main email design). Then the individual designs through a more dynamic way.

robov avatar Sep 28 '20 13:09 robov

Hi @robov, okay, so basically, you want to have a blade layout that is your base layout and be able to pick that from the maileclipse editor area?

So with a file structure below after creating the mailable

.
├── app/
│   └── Mail/
│       └── MailableClass.php
└── resources/
    └── views/
        ├── core/
        │   └── customer/
        │       └── layouts/
        │           └── email.blade.php <- exists already
        └── mail/
            └── mailable-class.blade.php

But instead of using the templates provided, the base is a blade file that takes a name that should be extended and saves that as the new mailable-class.blade.php file that looks like this:

@extends('core.customer.layouts.email')

@section('content')
 {-- content would go in here and the data that the editor targets--}
@endsection

ReeceM avatar Sep 28 '20 14:09 ReeceM