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.4] Allow Slack Notifications to use image urls #18011

Merged
merged 1 commit into from
Feb 21, 2017
Merged

[5.4] Allow Slack Notifications to use image urls #18011

merged 1 commit into from
Feb 21, 2017

Conversation

laurencei
Copy link
Contributor

@laurencei laurencei commented Feb 20, 2017

Currently the Laravel Notification channel for Slack seems to only support the 'icon_emoji'.

However Slack webhooks also allow you to provide an image URL - allowing you to use your own custom logo when sending a Slack notification - which is probably better for most Laravel Apps so they can include their logo?

This PR is fully BC. You can set a logo URL instead of an emoji:

public function toSlack($notifiable)
{
    return (new SlackMessage)
                ->from('My App')
                ->image('https://example.com/my-image.png')  
                ->content('This will be display my-image.png next to this alert on Slack');
}

p.s. I've tested this against the Slack API. If someone sets both an icon emoji and an icon image - Slack just uses the emoji with no complaints.

@taylorotwell taylorotwell merged commit e80a34e into laravel:5.4 Feb 21, 2017
@laurencei laurencei deleted the slack-notification-logos branch February 21, 2017 14:42
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.

2 participants