-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
invites: Add option to receive direct notification on accepted invitations. #28819
Conversation
Hello @zulip/server-onboarding members, this pull request was labeled with the "area: onboarding" label, so you may want to check it out! |
5c4280a
to
8cd21af
Compare
As requested in the PR template, please post screenshots of all your changes in the PR description. It is very difficult to review a video. |
Yeah sure, I have updated the PR description to add UI changes. |
Thanks! Looking at the screenshots, in the invite modal, let's move the checkbox to be just below the Emails text box. I've updated the issue as well. |
(I also filed #28834 while looking at this PR.) |
Sure, I have updated the code as well as created a PR fixing the new issue. |
8cd21af
to
d3c28b2
Compare
Thanks! @sahil839 are you up for reviewing this one? I haven't tested. |
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.
Posted few comments.
99aeaaf
to
383656e
Compare
@sahil839 I have addressed the previous feedbacks. Hope that works. |
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.
@shashank-23002 Posted a few comments related to avoiding passing the paramters where we already have a default for now in tests and migration.
Also, you should add a test for checking that the message is not sent when send_notification
is false.
zerver/migrations/0498_alter_preregistrationuser_send_notification.py
Outdated
Show resolved
Hide resolved
383656e
to
6ffe643
Compare
Thanks @sahil839 for the review. I think I have cleaned up the PR. |
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.
You need to test whether the message was received by the referrer when send_notification
is True
and not received when send_notification
is False
for the invite. You can do this by doing an appropriate query like we do here.
You can read the existing tests and then write the test accordingly.
6ffe643
to
c0a19c4
Compare
30a22d1
to
ec67786
Compare
ec67786
to
63e88aa
Compare
63e88aa
to
056cf78
Compare
@timabbott PTAL |
Cool thanks for bumping this, I'll see if I can review today. |
c324534
to
715caef
Compare
@timabbott bumping this thread so that this may not lose track. |
715caef
to
98ff5dd
Compare
@timabbott rebased the PR . Would be great if this could be reviewed fast as frequent conflicts arise and this might lose track now. |
Merged after making the following fixes to formatting and documentation language. @shashank-23002 thanks for the contribution! diff --git a/api_docs/changelog.md b/api_docs/changelog.md
index a5e54d4499..44ea8dca60 100644
--- a/api_docs/changelog.md
+++ b/api_docs/changelog.md
@@ -22,10 +22,10 @@ format used by the Zulip server that they are interacting with.
**Feature level 267**
-* [`GET /invites`](/api/get-invites),[`POST /invites`](/api/send-invites):
- Added a new field `notify_referrer_on_join`
- indicating whether the referrer has opted to receive direct messages
- from the notification bot when an invited user joins.
+* [`GET /invites`](/api/get-invites),[`POST /invites`](/api/send-invites): Added
+ `notify_referrer_on_join` parameter, indicating whether the referrer has opted
+ to receive a direct message from the notification bot whenever a user joins
+ via this invitation.
**Feature level 266**
diff --git a/web/templates/invite_user_modal.hbs b/web/templates/invite_user_modal.hbs
index 68115b62ee..d9ae432f94 100644
--- a/web/templates/invite_user_modal.hbs
+++ b/web/templates/invite_user_modal.hbs
@@ -30,7 +30,7 @@
<label class="checkbox display-block">
<input type="checkbox" id="receive-invite-acceptance-notification" checked/>
<span></span>
- {{t "Send me a direct message when my invitation is accepted"}}
+ {{t "Send me a direct message when my invitation is accepted" }}
</label>
</div>
<div class="input-group">
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 3700759116..71b1e99f9b 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -12515,9 +12515,13 @@ paths:
example: false
notify_referrer_on_join:
description: |
- "A boolean indicating whether the referrer would like to receive a direct message from Notification Bot a user account is created using this invitation."
+ A boolean indicating whether the referrer would like to receive a
+ direct message from [notification
+ bot](/help/configure-automated-notices) when a user account is created
+ using this invitation.
- **Changes**: New in Zulip 9.0 (feature level 267).Previously, referrers always received such direct messages.
+ **Changes**: New in Zulip 9.0 (feature level 267). Previously,
+ referrers always received such direct messages.
type: boolean
example: false
default: true
@@ -20701,11 +20705,12 @@ components:
notify_referrer_on_join:
type: boolean
description: |
- A boolean specifying whether the referrer has opted to receive direct messages
- from the notification bot when an invited user joins.
+ A boolean indicating whether the referrer has opted to receive a direct
+ message from [notification bot](/help/configure-automated-notices) when a user
+ account is created using this invitation.
- **Changes**: New in Zulip 9.0 (feature level 267).Previously, referrers always
- received such direct messages.
+ **Changes**: New in Zulip 9.0 (feature level 267). Previously,
+ referrers always received such direct messages.
link_url:
type: string
description: | |
@shashank-23002 are you up for updating https://zulip.com/help/invite-new-users#send-email-invitations to document this feature? |
Previously, when a referrer's invitation to Zulip was accepted, they got a notification from notification-bot indicating their invitation has been accepted. This commit adds an option for referrer to decide whether he wants to receive the direct notification from the notification-bot. Fixes: zulip#20398
Head branch was pushed to by a user without write access
f62f33a
to
e777a1e
Compare
Fixed failing tests , so a last quick view by @timabbott would do !!
@alya I would love to when I get time , but someone else may take this up for now if they want. |
OK. @laurynmm could you please add this bit of documentation to your list, then, so that it's done for 9.0? |
Merged, thanks @shashank-23002! Next time, post the diff for what you changed, it would make review a lot easier. |
Previously, when a user's invitation to Zulip was accepted, they received a direct message from welcome bot that their invitations has been accepted. However, some users may not want to receive such a message, e.g. because they are already following new user notifications in a stream, or they simply don't need to know when new users join.
Presently , there is an additional personal notification setting using you which you can decide whether you want to receive direct message from welcome bot when an invited user joins.
Fixes: #20398.
Screenshots and screen captures:
When the button is checked -
The notification bot message popped up for
test2
.When the button is unchecked -
The notification bot message didn't pop up for
test1
.Screen.Recording.2024-02-04.at.6.10.59.PM.mov
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: