notification
notification
is a helper send message notification use port adapter service.
available service:
Usage example
- Notification use mattermost service
c, err := notification.NewClient(mattermost.MattermostAdapter{
Service: &mattermost.MattermostNotif{
Cfg: &mattermost.Config{
SiteUrl: "http://localhost:8065",
AccessToken: "odh5mxnw1igc7k4u77k6qs5x7w",
TeamName: "clodeo",
}
}
})
if err != nil {
log.Println("error initialize notification client, err : ", err)
return
}
err = c.SendGroupMessage("clodeo-integrasi", notification.Message{
Title: "Tokopedia User Join",
Body: "**Mamas Rafi Buzer Joined**",
})
if err != nil {
log.Println("error post message, err : ", err)
return
}