-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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.3] Add greeting option to SimpleMessage notification #15108
Conversation
By default 'Hello!' or 'Whoops!' is displayed as greeting. You can override this with the `greeting()` method: ``` public function toMail($notifiable) { return (new MailMessage) ->greeting("Hi {$notifiable->name},") ->line('The introduction to the notification.') ->action('Notification Action', 'https://laravel.com') ->line('Thank you for using our application!'); } ```
@@ -21,6 +21,14 @@ class SimpleMessage | |||
public $subject; | |||
|
|||
/** | |||
* Greeting at the beginning of the notification. | |||
* If null, a greeting depending on the level will be displayed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrahamCampbell I don't know what you mean, I added a new line, styleci is failing now
I don't like nested ternarys. Can you get rid of that? |
@taylorotwell I replaced it with if-else : 0e193ea |
@balping: This broke the plain text email. |
How so? Is there a syntax error or something? |
There are no new lines after the greeting. I'll submit a PR to fix that. |
Ok, thanks and sorry about this |
No worries, I love the greeting. Much more flexibility! |
By default 'Hello!' or 'Whoops!' is displayed as greeting.
You can override this with the
greeting()
method: