-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Telegram notifications for users #1029
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1029 +/- ##
==========================================
- Coverage 44.18% 43.73% -0.45%
==========================================
Files 126 126
Lines 2904 2991 +87
Branches 653 680 +27
==========================================
+ Hits 1283 1308 +25
- Misses 1609 1670 +61
- Partials 12 13 +1
Continue to review full report at Codecov.
|
size-limit report 📦
|
Pull Request Test Coverage Report for Build 936678403
💛 - Coveralls |
86c9c2c
to
236e907
Compare
18b4857
to
a9cf849
Compare
45c386f
to
da048bc
Compare
da048bc
to
feb9355
Compare
feb9355
to
5eed05f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a quick view, plannig to go deeper later on
errors.New("missing parameter"), "address parameter is required", rest.ErrInternal) | ||
return | ||
} | ||
existingAddress, err := s.dataService.GetUserTelegram(siteID, user.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, if i understant "tricky to use SendErrorJSON" part this is about incorrect frame report? this can be solved with an extra param "skipFrames" of some sort. Not saying we have to refactor this, just a note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, just we'll need to have a nested function which also could potentially send an answer to the user (SendErrorJSON) so it would need request and response passed to it, and some boolean flag to check if we can carry on with our logic or that function took care about it for us and we need to just return immediately. It will hurt readability more than code duplication in my opinion.
@@ -156,7 +156,7 @@ _this is the recommended way to run remark42_ | |||
| auth.email.subj | AUTH_EMAIL_SUBJ | `remark42 confirmation` | email subject | | |||
| auth.email.content-type | AUTH_EMAIL_CONTENT_TYPE | `text/html` | email content type | | |||
| auth.email.template | AUTH_EMAIL_TEMPLATE | none (predefined) | custom email message template file | | |||
| notify.users | NOTIFY_USERS | none | type of user notifications (email) | | |||
| notify.users | NOTIFY_USERS | none | type of user notifications (telegram, email) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we need some detailed info about user's tg notif somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please elaborate on this one, documentation note on what is the trickiness of telegram notify?
a776e9f
to
0655e2a
Compare
I've fixed most of the review comments in the second commit for the reviewer convenience, looking forward to the next review round. |
0655e2a
to
761b5da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Would add backend support #830.
Verification message:
![image](https://user-images.githubusercontent.com/712534/121823885-5c4c2c00-cca8-11eb-9aa5-631c236159f1.png)
![image](https://user-images.githubusercontent.com/712534/121824001-3b380b00-cca9-11eb-85c8-fceb2b985375.png)
Reply notification:
For frontend (@akellbl4): when config option
telegram_bot_username
is not empty, telegram notifications are enabled. We need to ask the user to write a bot with that username (https://tg.me/$username) and then use his ID for subscription: send/getid
to https://tg.me/myidbot in Telegram messenger.