Skip to content

notifications: turn off a notification via email #14389

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

Closed
stirby opened this issue Aug 21, 2024 · 8 comments
Closed

notifications: turn off a notification via email #14389

stirby opened this issue Aug 21, 2024 · 8 comments
Assignees
Labels
good first issue Easily solved issues suitable for starters and community contributors

Comments

@stirby
Copy link
Collaborator

stirby commented Aug 21, 2024

A user may receive an email notification from Coder and then want to opt out of that specific template immediately. To support this case, we should add an option to all SMTP notifications that allows users to block a template like so:

stop_recieving_notif

Not a blocker for release and implementation depends on customer corroboration of this flow.

This would require a human-readable name for notification templates.

@stirby stirby added the feature label Aug 21, 2024
@dannykopping
Copy link
Contributor

I would suggest a slight rephrasing as simply "Stop receiving emails like this"; I don't think we need to include the template name here.

@dannykopping dannykopping added the good first issue Easily solved issues suitable for starters and community contributors label Aug 22, 2024
@joobisb
Copy link
Contributor

joobisb commented Aug 28, 2024

@dannykopping I would like to take a look at this

@dannykopping
Copy link
Contributor

@joobisb go for it 👍 let me know if you run into any issues. Thanks!

@joobisb
Copy link
Contributor

joobisb commented Aug 30, 2024

hi @dannykopping

I believe we cannot make direct API calls from the received email to our backend server due to CORS and other issues, so I was thinking of the following:

  • Instead of making an API call, add a query parameter to the "Manage Notifications" link. When the user lands on the notifications page, check for this parameter and perform the unsubscribe action.

  • In the frontend code, check for the unsubscribe parameter, perform the action (PUT api/v2/users/{user}/notifications/preferences API), and display the same Notification preferences updated toast.

wdyt ?

@dannykopping
Copy link
Contributor

Sounds good to me @joobisb!

@joobisb
Copy link
Contributor

joobisb commented Sep 11, 2024

Hi @BrunoQuaresma,

#14520 (comment) continuing this conversation here as I'm unable comment further on the PR

Thank you for reviewing the PR and merging it.

I appreciate you fixing the Notification stories as well, didn't know we could use decorators to spy the API before the story is rendered

had one question though, this message was added to show the user which template was disabled, wasn't it needed?

displaySuccess(`${template.name} notification has been disabled`);

@BrunoQuaresma
Copy link
Collaborator

@joobisb In order to obtain the template name, we would have to wait for the templates to be fetched, which would block the update request until that process was completed. In my opinion, having the name doesn't provide significant value as it slows down the action. Additionally, since the other toast messages don't include the template name, I think it would be acceptable to omit it. If we believe that including the name in the notification is essential, then we may need to update the API or possibly the email link to provide the name without blocking the delete action. Makes sense?

@joobisb
Copy link
Contributor

joobisb commented Sep 13, 2024

@joobisb In order to obtain the template name, we would have to wait for the templates to be fetched, which would block the update request until that process was completed. In my opinion, having the name doesn't provide significant value as it slows down the action. Additionally, since the other toast messages don't include the template name, I think it would be acceptable to omit it. If we believe that including the name in the notification is essential, then we may need to update the API or possibly the email link to provide the name without blocking the delete action. Makes sense?

@BrunoQuaresma it does. thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Easily solved issues suitable for starters and community contributors
Projects
None yet
Development

No branches or pull requests

4 participants