-
๐ค Iโm looking for help with Notify
-
๐ฏ Iโm looking to collaborate on Proji
-
๐ฑ Iโm currently learning to forecast the Cloud's weather.
-
๐ซ How to reach me [email protected]
-
โค๏ธ Open-Source Software
ย
A dead simple Go library for sending notifications to various messaging services.
License: MIT License
๐ค Iโm looking for help with Notify
๐ฏ Iโm looking to collaborate on Proji
๐ฑ Iโm currently learning to forecast the Cloud's weather.
๐ซ How to reach me [email protected]
โค๏ธ Open-Source Software
ย
Describe the missing service. Please provide useful links.
Add new service for Google chat. API docs can be found here.
Describe the missing service. Please provide useful links.
Add new service for home-assistant. API docs can be found here.
Is your feature request related to a problem? Please describe.
Missing support for the popular social network platform Twitter.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this dghubble/go-twitter seems to be our best option for implementing it.
Describe the missing service. Please provide useful links.
Describe the solution you'd like
Add a new service that
Potential libraries to use
https://github.com/go-lark/lark
https://github.com/chyroc/lark
Is your feature request related to a problem? Please describe.
Missing support for the popular messaging platform WhatsApp.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this Rhymen/go-whatsapp seems to be our best option for implementing it.
Describe the missing service. Please provide useful links.
Describe the solution you'd like
Users should be able to send messages/notifications via notify.
Potential libraries to use
official go driver -> https://github.com/mattermost/mattermost-server/blob/master/model/client4.go
reference -> https://github.com/containrrr/shoutrrr/tree/main/pkg/services/mattermost
API docs -> https://api.mattermost.com
I believe that we can create an interface to subscribe to all services. However, we will guarantee integrity in all methods.
e.g
type IServices interface{
New() interface{}
Send(string, string) error
}
type Telegram struct {
IServices // is obrigatory to create methods New and Send
client *tgbotapi.BotAPI
listener *tgbotapi.BotAPI
chatIDs []int64
}
func (t *Telegram) New() *Telegram {
return &Telegram{}
}
func (t *Telegram) Send(param1, param2 string) error{
return nill
}
see ya
Is your feature request related to a problem? Please describe.
Missing support for Viber.
Describe the solution you'd like
Implement a notification service and use existing services such as WhatsApp as a guide for implementation. At the time writing this, mileusna/viber seems to be the best client library for our service.
Is your feature request related to a problem? Please describe.
Hi! There is a problem that I don't know how to use it when I ready to use the email service.
Describe the solution you'd like
So we can give the more examples or docs that make more people like me know how to use it. It's very helpful.
Is your feature request related to a problem? Please describe.
Missing support for the popular social network platform Mastodon.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this mattn/go-mastodon seems to be our best option for implementing it.
Is your feature request related to a problem? Please describe.
Missing support for the popular email service platform Mailgun.
Describe the solution you'd like
Implement a notification service like already exists for Telegram etc. At the time writing the official Golang SDK mailgun/mailgun-go seems to be our best option for implementing it.
Is your feature request related to a problem? Please describe.
Missing support for the popular social network platform Instagram.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this ahmdrz/goinsta seems to be our best option for implementing it.
Hi, dear reader,
notify is currently untested and I'd love to change that but I'll be straight up honest with you, I don't know how you test a library that's so dependent on external services. Like, do you create test/pseudo accounts/bots on all supported platforms and use the real api-tokens while testing? Do you actually make calls to the external services to verify the lib is working or can this be solved by mocking?
Feedback and PRs would be really appreciated! Hope you enjoy the library and have a nice day! :)
Is your feature request related to a problem? Please describe.
Missing support for APNS (Apple Push Notification service).
Describe the solution you'd like
Implement a notification service and use existing services such as WhatsApp as a guide for implementation. At the time writing this, sideshow/apns2 seems to be the best client library for our service.
Is your feature request related to a problem? Please describe.
Missing support for the popular social network platform Facebook(-Messenger).
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this imbaggaarm/go-messenger seems to be our best option for implementing it.
Is your feature request related to a problem? Please describe.
Missing support for the popular social network platform WeChat.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this fideism/golang-wechat seems to be our best option for implementing it.
Describe the bug
Regarding the official documentation of the Rhymen/go-whatsapp API
Warning
This package is not being actively maintained currently and will soon be unusuable as WhatsApp updates to multi-device. Please look at tulir/whatsmeow for a Go WhatsApp Web API that is actively maintained and supports WhatsApp multi-device.
And the issues opened on it (Rhymen/go-whatsapp#644 & Rhymen/go-whatsapp#651), it seems that this API is no more usable.
Is there a plan to integrate the one proposed (whatsmeow) into Notify in the future?
Sorry guys, but I didn't understand if you really need this file: [service/pseudo/pseudo.go](https://github.com/nikoksr/notify/blob/main/service/pseudo/pseudo.go)
Is your feature request related to a problem? Please describe.
Missing support for the popular social network platform Microsoft Teams.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this atc0005/go-teams-notify seems to be our best option for implementing it.
Demo
func Service() {
// Create a telegram service. Ignoring error for demo simplicity.
mailService := mail.New("[email protected]", "smtp.163.com:465")
mailService.AuthenticateSMTP("", "[email protected]", "xxxxxx", "smtp.163.com")
mailService.AddReceivers("[email protected]")
notify.UseServices(mailService)
// Send a test message.
err := notify.Send(
context.Background(),
"Subject/Title",
"The actual message - Hello, you awesome gophers! :)",
)
if err != nil {
log.Println(err)
}
}
Is your feature request related to a problem? Please describe.
Missing support for Firebase Cloud Messaging.
Describe the solution you'd like
Implement a notification service and use existing services such as WhatsApp as a guide for implementation. At the time writing this, appleboy/go-fcm seems to be the best client library for our service.
List of features/changes we want to finish before releasing an official v1 version:
Please note that this list is not final.
Is your feature request related to a problem? Please describe.
Missing support for the popular Amazon service Simple Email Service (SES).
Describe the solution you'd like
Implement a notification service like already exists for Telegram etc. At the time writing the official Amazon Golang SDK aws/aws-sdk-go is the best option for implementing it.
Describe alternatives you've considered
What is the preferred package name for this service. Should i named it amazonses or is there any other suggestion?
My module:
package mess
import (
"context"
"github.com/nikoksr/notify"
"github.com/nikoksr/notify/service/telegram"
)
func Telegram(message string) {
telegramService, _ := telegram.New("mykey")
telegramService.AddReceivers(1234)
notify.UseServices(telegramService)
_ = notify.Send(context.Background(), "", message)
}
My call in main.go:
package main
import (
"mod/mess"
)
func main() {
mess.Telegram("Wtf 1 !?")
mess.Telegram("Wtf 2 !?")
mess.Telegram("Wtf 3 !?")
}
Outputs:
Wtf 1 !?
Wtf 2 !?
Wtf 2 !?
Wtf 3 !?
Wtf 3 !?
Wtf 3 !?
Any ideas?
Is your feature request related to a problem? Please describe.
N/A
Describe the solution you'd like
It would be great to see the use of Go Mail used in this project. https://github.com/ainsleyclark/go-mail
I think this will add SparkPost, Postal and Postmark support for free with no external dependencies.
I've noticed the go.mod file is quite large and this maybe a great opportunity to make it smaller by using the Mail drivers in the package outlined. All drivers in the Go Mail package use the std lib http client.
Describe alternatives you've considered
N/A
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/ci.yml
actions/setup-go v3
actions/checkout v3
actions/cache v3
codecov/codecov-action v3
actions/checkout v3
golangci/golangci-lint-action v3
.github/workflows/codeql-analysis.yml
actions/checkout v3
github/codeql-action v2
github/codeql-action v2
github/codeql-action v2
go.mod
go 1.19
github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f@c0650d8dff0f
github.com/Rhymen/go-whatsapp v0.1.1
github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20220811115547-6c7006b790b8@6c7006b790b8
github.com/atc0005/go-teams-notify/v2 v2.6.1
github.com/aws/aws-sdk-go-v2 v1.16.10
github.com/aws/aws-sdk-go-v2/config v1.16.0
github.com/aws/aws-sdk-go-v2/credentials v1.12.12
github.com/aws/aws-sdk-go-v2/service/ses v1.14.12
github.com/aws/aws-sdk-go-v2/service/sns v1.17.12
github.com/blinkbean/dingtalk v0.0.0-20210905093040-7d935c0f7e19@7d935c0f7e19
github.com/bwmarrin/discordgo v0.25.0
github.com/cschomburg/go-pushbullet v0.0.0-20171206132031-67759df45fbb@67759df45fbb
github.com/dghubble/go-twitter v0.0.0-20220716041154-837915ec2f79@837915ec2f79
github.com/dghubble/oauth1 v0.7.1
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible
github.com/line/line-bot-sdk-go v7.8.0+incompatible
github.com/mailgun/mailgun-go/v4 v4.8.1
github.com/pkg/errors v0.9.1
github.com/plivo/plivo-go/v7 v7.10.0
github.com/sendgrid/sendgrid-go v3.11.1+incompatible
github.com/silenceper/wechat/v2 v2.1.3
github.com/slack-go/slack v0.11.2
github.com/stretchr/testify v1.8.0
github.com/textmagic/textmagic-rest-go-v2/v2 v2.0.3361
github.com/utahta/go-linenotify v0.5.0
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4@886fb9371eb4
github.com/appleboy/go-fcm v0.1.5
github.com/go-lark/lark v1.7.2
github.com/google/go-cmp v0.5.8
github.com/kevinburke/twilio-go v0.0.0-20220615032439-b0fe9b151b0e@b0fe9b151b0e
Describe the solution you'd like
The ability send message to specific recevier
telegramService, _ := telegram.New("your_telegram_api_token")
notify.UseServices(telegramService)
fooReceiver := telegram.Receiver(-1234567890)
barReceiver := telegram.Receiver(-0987654321)
// Send a message to fooReceiver .
_ = notify.To(fooReceiver).Send(
context.Background(),
"Hello",
"The message to fooReceiver",
)
// Send another message to barReceiver
_ = notify.To(fooReceiver).Send(
context.Background(),
"Hello",
"The message to barReceiver",
)
Hiya. I'm digging into the source as I'm trying to figure out how to use notify, and came across this line in send.go
that seems to have a pointless line of code at line 25:
service := service
I can send a PR to clean up this and a few small things like comments, but just want to make sure this isn't doing something non-obvious...
Is your feature request related to a problem? Please describe.
Since notify.Send may basically send a message to a huge amount of receivers, the user might appreciate to have the ability to cancel long running send executions.
Describe the solution you'd like
To achieve this behavior we will add a context.Context to the parameters of notify.Send.
Current notify.Send signature:
func (n Notify) Send(subject, message string) error {
...
}
New notify.Send signature:
func (n Notify) Send(ctx context.Context, subject, message string) error {
...
}
This needs to be done for every services implementation of the send method. The respective implementations will then need to check if the context got cancelled.
Example implementation:
func (s SomeService) Send(ctx context.Context, subject, message string) error {
...
for _, receiver := range s.receivers {
select {
case <-ctx.Done():
return nil // Context got cancelled; just return
default:
_, _ = t.client.Send(receiver, message)
}
}
}
return nil
}
Is your feature request related to a problem? Please describe.
I'm using secure messengers - Signal and Matrix, I would like to have notifications there instead of have to use third, or fourth messenger.
Describe the solution you'd like
I would like to send notifications to unencrypted Matrix channels (I know the encrypted ones may not be possible) and/or to Signal groups.
Shoutrrr has support for Matrix: https://containrrr.dev/shoutrrr/v0.5/services/matrix/
Apprise has support for both Signal and Matrix: https://github.com/caronc/apprise
Is your feature request related to a problem? Please describe.
Missing support for the popular messaging platform Line.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this line/line-bot-sdk-go seems to be our best option for implementing it.
Describe the bug
There is an error in the Syslog test that causing error when running make test
To Reproduce
Steps to reproduce the behavior:
make test
Expected behavior
Syslog test should be passed and all tests will be passed
System
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
Missing support for the popular email service platform SendGrid.
Describe the solution you'd like
Implement a notification service like already exists for Telegram etc. At the time writing the official Golang SDK sendgrid/sendgrid-go seems to be our best option for implementing it.
Describe alternatives you've considered
Should we place the implementation under the mail
package with the following constructor mail.NewSendGrid(...)
or into a new separate package sendgrid
?
Is your feature request related to a problem? Please describe.
Hey guys,
first of all, thanks for the really unbelievable support and interest so far. I recently had the idea that
there might be interest in a UI for notify.
Describe the solution you'd like
My first thought was a TUI with an input field, a history and a list of platforms to which the messages are sent - kind of the interface of most messengers today.
Wow, great colors for dark mode, sorry for that
Here is a small sketch of it:
Please remember, I am definitely not a designer and this sketch is just about the basic layout to give you an idea of what I had in mind. Btw this note was created with penpot.
The green and red at the platform names indicate whether the communication was successful or not. Again, this is just an idea and not a final version, please leave your ideas for a better design in the comments if you are interested.
Feeback and your suggestions are very welcome.
Is your feature request related to a problem? Please describe.
As someone exploring a library or a contributor, it can be messy to create a sandbox project to test out the local version.
I'm not sure if this is worth maintaining, but I just wanted to propose the idea.
Describe the solution you'd like
An example folder, similar to how it's done in the webpush-go package can solve this easily.
The example folder may contain examples for each type service, with the required setup code.
Is your feature request related to a problem? Please describe.
As discussed here the error handling in notify.Send might not fit everybodys needs. There might be occasions where you want Notify to immediately stop sending the message to the other receivers in case the preceding receiver was not reachable. Maybe its a very crucial message and you need to make sure that it was send to all receivers successfully. On the other hand there might be occasions where you don't care if Notify might not be able to reach some of the receivers and you just want it to continue after not reaching a receiver.
Describe the solution you'd like
In addition to the current notify.Send method we will add the notify.MustSend method. notify.Send will keep its current behavior which is to keep sending messages even after an error occured but.. it will need to collate all errors into one (something like #22). Instead of joining these errors I'm rather thinking about adding a custom error type which holds an array of unreachable receivers. notify.MustSend on the other will return the first error right after it occurs, basically skipping all remaining receivers.
Example for new error:
type ErrSendToReceivers struct {
Receivers []string
Err error
}
Is your feature request related to a problem? Please describe.
Missing support for Web Push Notifications.
Describe the solution you'd like
Implement a notification service and use existing services such as WhatsApp as a guide for implementation. At the time writing this, SherClockHolmes/webpush-go seems to be the best client library for our service.
Describe the missing service. Please provide useful links.
Gmail is one of the mail providers that is used by many people. I think adding a Gmail service to notify
will attract people to use more this library.
It will be possible to implement because GMail has an API to interact. See more details: https://developers.google.com/gmail/api/quickstart/go
Describe the solution you'd like
Potential libraries to use
Is your feature request related to a problem? Please describe.
This is related to j-wil's comment in the discussion about the testing procedure for external services. We currently have no standards for external services that are integrated into notify, even though certain minimum requirements have of course been taken into account up to now.
Describe the solution you'd like
As suggested by @j-wil, we need some sort of review process for the libraries behind the services that are potentially to be integrated. I suggest that we keep creating issues in style of #5 to propose the integration of a new service and that in the comment section of this issue we discuss which candidate would be the best fit for notify.
Suggestions for possible criteria:
Please suggest other criteria in the comments or critique the example criteria given if needed.
Is your feature request related to a problem? Please describe.
Missing support for the popular team communication platform RocketChar.
Describe the solution you'd like
Implement a notification service like we already did for Telegram etc. At the time writing this RocketChat/Rocket.Chat.Go.SDK seems to be our best option for implementing it.
Is your feature request related to a problem? Please describe.
N/A
Describe the solution you'd like
It would be great to support Workplace by Facebook. I'm not sure if this is in tandem with the ticket open re supporting Facebook. But I'm pretty sure the Workplace API allows the sending of messages very easily.
Many thanks.
Describe alternatives you've considered
N/A
Additional context
https://developers.facebook.com/docs/workplace/bots/
Is your feature request related to a problem? Please describe.
Missing support for Twilio.
Describe the solution you'd like
Implement a notification service and use existing services such as WhatsApp as a guide for implementation. At the time writing this, kevinburke/twilio-go seems to be the best client library for our service.
Is your feature request related to a problem? Please describe.
Missing support for the business level sms messaging platform TextMagic.
Describe the solution you'd like
Implement a notification service like we already did for Plivo etc. At the time writing this textmagic/textmagic-rest-go-v2 seems to be our best option for implementing it. Further note the offical Go usage examples by TextMagic.
Describe the bug
The link to Mozilla's code of conduct Enforcement ladder under the Attribution section just redirects to mozilla inclusion repo.
Is your feature request related to a problem? Please describe.
Presently when sending a notification, an error in sending to one receiver will cause stop all further messages.
It would be nice if the service first attempted to notify to all other recievers.
package main
import (
"github.com/nikoksr/notify"
"github.com/nikoksr/notify/service/slack"
)
func main() {
notifier := notify.New()
// Provide your Slack OAuth Access Token
slackService := slack.New("OAUTH_TOKEN")
slackService.AddReceivers([]string{"INVALID_CHANNEL", "VALID_CHANNEL"})
notifier.UseService(slackService)
// This will error on the first reciever ("INVALID_CHANNEL")
// and the "VALID_CHANNEL" will never receive a message
_ = notifier.Send(
"Hello :wave:\n",
"I am a bot written in Go!",
)
}
Describe the solution you'd like
Either collate the errors and return them after all recievers have been attempted (i.e. add the errors to a slice), or find a more elegant way to collate meta-errors.
Pseudocode:
func ... Send(subject, message string) error {
sendErrors := make([]string, 0, 0)
for ... {
if err != nil {
sendErrors = append(sendErrors, errors.Wrapf(err, ...).Error())
}
}
// This has the advantage of being "nil" in the case of no errors
// but is perhaps inelegant / overly verbose
if sendErrors != nil {
return errors.New(strings.Join(sendErrors, "\n"))
}
return nil
}
Describe alternatives you've considered
If errors are all expected to be of the same type, perhaps better to just collate the channel ids? I believe a similar field exists for all services.
Any current library like this for Python?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.