Skip to content
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

Merged
merged 7 commits into from
Aug 28, 2016
Merged

[5.3] Add greeting option to SimpleMessage notification #15108

merged 7 commits into from
Aug 28, 2016

Conversation

balping
Copy link
Contributor

@balping balping commented Aug 28, 2016

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!');
}

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline.

Copy link
Contributor Author

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

@taylorotwell
Copy link
Member

I don't like nested ternarys. Can you get rid of that?

@balping
Copy link
Contributor Author

balping commented Aug 28, 2016

@taylorotwell I replaced it with if-else : 0e193ea

@taylorotwell taylorotwell merged commit 6421e33 into laravel:5.3 Aug 28, 2016
@tillkruss
Copy link
Collaborator

@balping: This broke the plain text email.

@balping
Copy link
Contributor Author

balping commented Aug 28, 2016

How so?

Is there a syntax error or something?

@tillkruss
Copy link
Collaborator

There are no new lines after the greeting. I'll submit a PR to fix that.

@balping
Copy link
Contributor Author

balping commented Aug 28, 2016

Ok, thanks and sorry about this

@tillkruss
Copy link
Collaborator

No worries, I love the greeting. Much more flexibility!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants