spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

Customized views don't seem to change transactional mails layout #262

Closed nckrtl closed 3 years ago

nckrtl commented 3 years ago

I came across the following issue in Mailcoach standalone ap ( (installed as a project via composer, v3.01). I haven't tested this with Mailcoach as a package

When you publish the mail views with php artisan vendor:publish --tag mailcoach-views and change a blade view, the changes won't take effect in the transactional test email. Also clearing the view cache doesn't work.

I created a video to demonstrate the issue: https://www.youtube.com/watch?v=lptfuZI5DtY&feature=youtu.be

Customizations in the css do have affect when editing views/mailcoach/mails/layout/mailcoach.css just not the blade files

riasvdv commented 3 years ago

The test mail views are from the mailcoach-ui-views package, since they're only needed in the UI, try publishing those views.

nckrtl commented 3 years ago

Yes I can adjust the content of the test mail when publishing those view. However, I still wasn't able to apply changes to the markup of the email as it uses the message component (@component('mail::message').

With a bit looking around I noticed message.blade.php in /views/mails/layout. I tried editing that file but it didn't have any effect.

So in the test email I changed the component to mailcoach::mails.layout.message and then it was picking up the changes from message.blade.php

Is this recommended to do? Or should mail::message also refer to the correct file?

freekmurze commented 3 years ago

@nckrtl does this change fix the problem for you? https://github.com/spatie/mailcoach-ui/pull/3

nckrtl commented 3 years ago

Yes I can edit the templates accordingly. I'm just wondering if the edit (mail::message to mailcoach::mails.layout.message) in the component directive of /views/vendor/mailcoach-ui/mails/test.blade.php is the correct way to make it work.

freekmurze commented 3 years ago

So in the test email I changed the component to mailcoach::mails.layout.message and then it was picking up the changes from message.blade.php

Yes, you can go about it that way 👍