Home / Snippets / Default Email Subject in Laravel Notifications
Default Email Subject in Laravel Notifications cover

Default Email Subject in Laravel Notifications

328

3 years ago

0 comments

When creating Laravel Notification and you don't specify a subject to the "toMail" method, the default class name will be used as the default email subject. So the CamelCased name of your class will be read by Laravel and it will become the email subject by default.

So if your notification class is like below:
class UserConfirmationEmail extends Notification
{
  // your code here
}

Then the email notification that the user will receive will have the subject of "User Confirmation Email".
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this