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

[Feat] Allow people to subscribe to Cachet updates #220

Closed
wants to merge 2 commits into from

Conversation

joelbutcher
Copy link
Collaborator

Subscribers and email notifications is a huge topic for this repo. This PR is the first in a line of PR's for this feature.

This PR allows users to register their interest in subscribing to email updates with Cachet.

User flow

Create a new view with a form for users to register interest.

This bit took the longest, as I'm not much of a frontend developer but by leaning into the forms stuff filament has, we're able to create a clean form that matches the cachet status-page theming as close as possible (a few things like border and ring don't translate here).
screenshot

Success banner

I've added a new "success" banner which will show whenever session()->flash('success') is set:
screenshot 1

Subscriber email verification

By extending Laravel's default VerifyEmail notification class, all we need to do is change the URL that is generated and register the verification route. Laravel takes care of the rest as long as the model can be ->notify()'d.

Note

We might want to change the email message and template theme in the future

screenshot 2

Verification

User gets verified and another success banner is shown:
screenshot 3

@joelbutcher
Copy link
Collaborator Author

@jbrooksuk this PR supersedes #215

@jbrooksuk
Copy link
Member

Huge work, @joelbutcher 👏🏻

I'm going to make a couple of changes here before we merge. Mostly in design of the success banner :)

commit 85d8c78
Author: Joel Butcher <[email protected]>
Date:   Thu Jan 23 20:28:42 2025 +0000

    feat: allow people to subscribe

    refactor: use existing action to create subscriber

    chore: remove strict_types

    feat: listener to fire subscriber verification email

    chore: queue configuration

    refactor: terminology and form location

    wip

    wip

    fix CI

    use verify_code to validate request

    fulfil verification

commit 20139e9
Merge: 70964e8 85c6189
Author: Joel Butcher <[email protected]>
Date:   Wed Jan 22 11:19:56 2025 +0000

    Merge branch 'main' into feat/subscriber-emails

commit 85c6189
Author: jbrooksuk <[email protected]>
Date:   Wed Jan 22 09:19:07 2025 +0000

    Compile Assets

commit 75f686c
Author: AndrewL <[email protected]>
Date:   Wed Jan 22 17:17:16 2025 +0800

    Updated PH localization (#213)

    Co-authored-by: thestrongestgenius <[email protected]>

commit fc4b25e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 22 09:16:47 2025 +0000

    Bump vite from 5.4.8 to 5.4.14 (#214)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 56b0163
Author: jbrooksuk <[email protected]>
Date:   Tue Jan 21 21:24:10 2025 +0000

    Fix code styling

commit 1b32bc3
Author: James Brooks <[email protected]>
Date:   Tue Jan 21 21:20:28 2025 +0000

    Support the `HTTP_REMOTE_USER` header (#208)

commit 91434f1
Author: Kev <[email protected]>
Date:   Tue Jan 21 21:59:04 2025 +0100

    New adjustments added for German translation and added Dutch (#209)

commit 391010d
Author: jbrooksuk <[email protected]>
Date:   Tue Jan 21 14:00:36 2025 +0000

    Fix code styling

commit 24eff0c
Author: James Brooks <[email protected]>
Date:   Tue Jan 21 13:58:47 2025 +0000

    wip

commit 5cb444c
Author: James Brooks <[email protected]>
Date:   Tue Jan 21 13:51:40 2025 +0000

    Use Cachet class to determine correct User model

commit 70964e8
Author: Joel Butcher <[email protected]>
Date:   Tue Jan 21 11:36:45 2025 +0000

    create form blade view

commit 3327135
Author: Joel Butcher <[email protected]>
Date:   Tue Jan 21 11:32:56 2025 +0000

    drop tel

commit 6926566
Author: Joel Butcher <[email protected]>
Date:   Tue Jan 21 11:21:44 2025 +0000

    Playing with form submission

commit 268ed60
Author: Joel Butcher <[email protected]>
Date:   Tue Jan 21 10:21:06 2025 +0000

    Subscriptions base form

commit 028f9d3
Author: James Brooks <[email protected]>
Date:   Tue Jan 21 08:38:05 2025 +0000

    Update build-api-docs.yml

commit dd15050
Author: James Brooks <[email protected]>
Date:   Mon Jan 20 20:41:33 2025 +0000

    Update build-api-docs.yml

commit 812b201
Author: James Brooks <[email protected]>
Date:   Mon Jan 20 20:31:27 2025 +0000

    Update build-api-docs.yml

commit 38507f0
Author: jbrooksuk <[email protected]>
Date:   Mon Jan 20 20:28:23 2025 +0000

    Fix code styling

commit b8ea810
Author: romalytvynenko <[email protected]>
Date:   Mon Jan 20 22:26:19 2025 +0200

    API specification generation (#178)

commit 28ae3f1
Author: Kev <[email protected]>
Date:   Mon Jan 20 17:33:21 2025 +0100

    Multiple updates for german translation files (#206)
@joelbutcher joelbutcher added this to the v3.0 milestone Jan 25, 2025
@joelbutcher joelbutcher self-assigned this Jan 25, 2025
@joelbutcher joelbutcher requested a review from jbrooksuk January 25, 2025 16:53
Copy link
Member

@jbrooksuk jbrooksuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joelbutcher I've made a couple of small changes so far. The success banner is now a toast as I found it strange seeing the status bar (which can be in a "successful" state).

There's a few things we need to address here:

  1. We need to add a setting to "Manage Cachet" that allows you to enable subscribers. We do have a setting in 2.4 that we'll need to migrate too (I think I did that already).
  2. What happens if you subscribe to Cachet, then I enter your email address and change your settings without you knowing? I wonder if, when you're subscribed, we send an email that sends you to a signed URL that allows you to change your subscriptions.
  3. This can be a future feature, but we should allow subscribing to groups and "new incidents".

@joelbutcher
Copy link
Collaborator Author

@jbrooksuk thanks!

We need to add a setting to "Manage Cachet" that allows you to enable subscribers. We do have a setting in 2.4 that we'll need to migrate too (I think I did that already).

Is this something you want doing in this PR, or in another one?

What happens if you subscribe to Cachet, then I enter your email address and change your settings without you knowing? I wonder if, when you're subscribed, we send an email that sends you to a signed URL that allows you to change your subscriptions.

  • Can this happen? I thought there was a unique column restriction on the subscribers table? The form currently only creates a subscriber, so if I enter another users email address and change the settings, it should either error out, or just redirect and not make any changes.

  • For the Signed URL thing that would make sense to me - I'll add that into this PR

we should allow subscribing to groups and "new incidents".

I was thinking of having a toggle in each group that was "subscribe to all updates for :group".

@AdoDreamtilt
Copy link

Any chance you can also have a mobile number added with subscriber submission option for SMS messages for the subscribers? (And allow for future SMS integration with SMS providers to subscribers?)

@jbrooksuk
Copy link
Member

@AdoDreamtilt this is something we'll look into bringing back once we have the main system in place 👍🏻

I do think we'll need to pick one (maybe two) SMS providers though - or provide a way for Cachet to add additional providers easily.

@joelbutcher joelbutcher closed this by deleting the head repository Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants