npm i --save @romainmarecat/ngx-slack-notification
import { SlackModule } from '@romainmarecat/ngx-slack-notification';
@NgModule({
imports: [
SlackModule.forRoot('HTTPS://YOUR-SLACK-WEBHOOKS')
]
})
import { SlackNotificationService } from '@romainmarecat/ngx-slack-notification';
export class ExampleComponent extends OnInit {
constructor(private slackNotificationService: SlackNotificationService) {
}
ngOnInit() {
this.slackNotificationService.notify({
text: 'Hello World <https://alert-system.com/alerts/1234|Click here> ! Bye.',
username: 'System',
icon_emoji: ':camel:'
});
}
}