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

Slack: as_user or icon #48

Closed
drjonnicholson opened this issue Mar 2, 2017 · 2 comments
Closed

Slack: as_user or icon #48

drjonnicholson opened this issue Mar 2, 2017 · 2 comments

Comments

@drjonnicholson
Copy link

Hi,

I've noticed that when an exception logs through to slack it uses the default bot icon rather than the icon I've given the bot. Bit frustrating.

Looking at the documentation for slack it appears this is because as_user setting is false by default and then it uses a default icon.

How can I add this setting to the slack notifier (and/or be able to customize the icon used by emoji/url)?

@tylercd100
Copy link
Owner

I dont personally use slack but try setting a value for iconEmoji in the config

/**
 * Slack settings
 */
'slack'=>[
    'token'   => env('SLACK_APP_TOKEN'), //https://api.slack.com/web#auth
    'channel' => env('SLACK_CHANNEL', '#exceptions'), //Dont forget the '#'
    'username' => env('SLACK_USERNAME', 'LERN'), //The 'from' name
    'iconEmoji' => "Some value"
],

@drjonnicholson
Copy link
Author

Thanks for the reply. Adding 'iconEmoji' => ":scream:" worked. So as a workaround I have made a cusom emoji (https://get.slack.help/hc/en-us/articles/206870177-Creating-custom-emoji) with the image I want to use. Now I can successfully post with the expected icon, even if it's not actually using the icon assigned to the bot.

I dug into the code and this looks to be a limitation of the underlying monolog handler? Might be something to pass up the chain. But in any event my issue is resolved enough for me not to worry about it anymore - thanks for the help 😄

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

No branches or pull requests

2 participants