Skip to content
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

UI for email subscription #496

Closed
umputun opened this issue Dec 17, 2019 · 14 comments · Fixed by #537
Closed

UI for email subscription #496

umputun opened this issue Dec 17, 2019 · 14 comments · Fixed by #537
Assignees
Milestone

Comments

@umputun
Copy link
Owner

umputun commented Dec 17, 2019

With the backend part in place (thx to @paskal) we can integrate it on the UI side. This should be something similar to email-based login, i.e:

  1. Add a link "subscribe to email notification"
  2. Click on this link will ask for email and show confirmation dialog expecting a token
  3. Token will be sent to the user by email, the same way as we send confirmations for email auth
  4. Subscribed user should be able to unsubscribe from UI

API for email notifications documented in the readme

@Reeywhaar - let me know if you want to handle this one, should be very similar to email auth you did before.

@umputun umputun added this to the v1.5 milestone Dec 17, 2019
@umputun
Copy link
Owner Author

umputun commented Dec 17, 2019

related: #495 #494

@paskal
Copy link
Sponsor Collaborator

paskal commented Dec 17, 2019

  1. https://www.mailgun.com/ is the easiest way to get a server for email notifications, docker-compose configuration for it would look similar to this:
            - NOTIFY_EMAIL_HOST=smtp.eu.mailgun.org
            - [email protected]
            - NOTIFY_EMAIL_PASSWORD=password
            - [email protected]
            - NOTIFY_EMAIL_PORT=465
            - NOTIFY_EMAIL_TLS=true
    
  2. remark.rest file has working examples of requests to run against local docker-compose setup, after which you will have chosen email account verified and receiving notifications.
  3. A note on the implementation: when users subscribing to email notifications, they will get all replies to all their comments on the site.
  4. A small fix to apply with implementing this feature: email verification currently have text Copy and paste this text into “token” field on comments page — it should be changed to something like on email verification page when it will be know how it will be named.
    https://github.com/umputun/remark/blob/d23d119d70e015d65aaf155713f615056181df96/backend/app/notify/email.go#L128
    image

@akellbl4
Copy link
Collaborator

@umputun I can do it. Where should be placed subscribe button?

@paskal
Copy link
Sponsor Collaborator

paskal commented Jan 1, 2020

Another note: /config endpoint now has email_notifications boolean property which tells UI if notifications interface should be enabled.

@umputun
Copy link
Owner Author

umputun commented Jan 2, 2020

@akellbl4 sorry, missed your question. Thx for volunteering, appreciate it.

This subscribe button (link?) should be around other subscriptions

6cdc9-202001-02144447-ln7nj

In some other ticket, I have proposed to change the plain list of subscriptions to something under dropdown or whatever control makes sense. As far as I recall the problem on the UI side was how to make it mobile-friendly. Feel free to propose any improvements for this block, as of now all this "subscribe" part is way too visible for such a non-primary functionality.

@akellbl4
Copy link
Collaborator

akellbl4 commented Jan 4, 2020

@umputun I made UI example, If it is good for you I will go to logic.
2020-01-04 18 33 19

@paskal
Copy link
Sponsor Collaborator

paskal commented Jan 4, 2020

3. A note on the implementation: when users subscribing to email notifications, they will get all replies to all their comments on the site.

Unfortunately at this very moment that’s the only variant of email subscription.

@paskal
Copy link
Sponsor Collaborator

paskal commented Jan 4, 2020

I would suggest having something like Subscribe to <Thread via RSS><Site via RSS><Replies via RSS><Replies via Email> which will decrease occupied space as well.

@akellbl4
Copy link
Collaborator

akellbl4 commented Jan 4, 2020

@umputun @paskal something like that?
2020-01-04 22 55 48

@paskal
Copy link
Sponsor Collaborator

paskal commented Jan 4, 2020

LGTM, but I wonder how would it look and feel like from mobile.

@umputun
Copy link
Owner Author

umputun commented Jan 4, 2020

yeah. I'd call "Email" as "Replies via email", or even better would make two sections with headers (RSS and Email) in each one

@akellbl4
Copy link
Collaborator

akellbl4 commented Jan 4, 2020

I think it is the best variant :)
2020-01-04 23 36 33
2020-01-04 23 37 05

@akellbl4 akellbl4 self-assigned this Jan 4, 2020
@umputun
Copy link
Owner Author

umputun commented Jan 4, 2020

nice

@akellbl4
Copy link
Collaborator

akellbl4 commented Jan 5, 2020

@paskal I wrote some code for sending email verification but I won't receive emails with a token. At the same time, the email login works fine.
You can checkout my code from here maybe I did something wrong. I am not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants