Closed FabRiviere closed 1 year ago
symfony composer req slack-notifier
symfony console secrets:set SLACK_DSN
et on fait pareil pour la production :
symfony console secrets:set SLACK_DSN --env=prod
framework:
notifier:
chatter_transports:
slack: '%env(SLACK_DSN)%'
# texter_transports:
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent: ['email']
high: ['email']
medium: ['email']
low: ['email']
admin_recipients:
- { email: "%env(string:default:default_admin_email:ADMIN_EMAIL)%" }
Ajout de la méthode getChannels() , sans oublier les use qui vont avec.
public function getChannels(RecipientInterface $recipient): array
{
if (preg_match('{\b(great|awesome)\b}i', $this->comment->getText())) {
return ['email', 'chat/slack'];
}
$this->importance(Notification::IMPORTANCE_LOW);
return ['email'];
}