-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.8] Add template theme to mail notifications #29132
[5.8] Add template theme to mail notifications #29132
Conversation
Merge latest 5.8
5deaa5f
to
dfb7ef5
Compare
dfb7ef5
to
6efe70b
Compare
We already can set a different theme than the default one for our Mailable. It would be very useful if there was a way to set the theme for the mail notifications too.
6efe70b
to
aed06b1
Compare
Would there be any interest in backporting this to 5.7? We are using 5.7 here and it would be useful for us. |
Laravel 5.7 is not accepting new features now, since it is EOL. Only security fixes. Please upgrade to Laravel 5.8. |
@GrahamCampbell Upgrading a framework is easier said that done for some teams and products. Especially if 5.7 to 5.8 is a major framework upgrade as defined here: https://laravel.com/docs/5.8/releases#versioning-scheme |
@martinbean Laravel Shift can help you: https://laravelshift.com/ |
@driesvints I’m not having issues upgrading…? I was just empathising with @troccoli and trying to convey to @GrahamCampbell that not every developer is able to perform an upgrade to a major framework version every ~6 months, i.e. if a developer is working for a company with limited resources. |
@martinbean you said:
So I was just pointing out to a tool that could help you upgrade faster/easier. |
@driesvints Again, it’s not me in that situation, but have worked in product teams in the past where shipping features is a higher priority for teams than keeping package versions up to date. |
@martinbean I don't want to get into a "priority" discussion here. I've worked in teams before where upgrading isn't always a top priority. But you're gonna be left behind and run into security risks/bugs eventually if you do. Expecting others to keep maintaining old versions if you're not willing to upgrade is kind of demanding if you ask me. |
LTS releases are also available. For example, StyleCI is actually running on Laravel 5.5 LTS. This is so I don't have to spent lots of time upgrading every few months. |
Features are very rarely backported however. If you need new features from the core, then upgrading is the only way. |
Nice idea, definitely like it! It would be great though to get it documented in the docs. |
Absolutely @DevDavido. I'm on holiday atm though so it will have to wait a week or two. And with regards to all the comments about my asking about 5.7 I just want to say that I'm ok not doing it. I find it a bit odd that it already accept only security fixes but it's not my repo or my policy. |
Unless I'm misunderstanding, I don't think this change is backwards-compatible — it's broken the custom Markdown mail styling I was using in my app. In /**
* The current theme being used when generating emails.
*
* @var string|null
*/
public $theme = 'default'; Previously, the return new Markdown($this->app->make('view'), [
'theme' => $config->get('mail.markdown.theme', 'default'),
'paths' => $config->get('mail.markdown.paths', []),
]); After this change, anyone who had changed their |
That's interesting. Which version are you using? The reason I submitted the PR was that I needed an easy way to change the theme for notification and I didn't find one in 5.7. |
It is already possible, and quite easily, to set a theme for any Mailables. This is not the case for the mail Notifications, which always use the default theme.
With this PR it would be possible to do something like
This will use
notification.css
theme inresources/views/vendor/mail/html/themes
.