-
-
Notifications
You must be signed in to change notification settings - Fork 774
fix(api): send verification email upon public status page email subscription (#2571) #2588
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
615b8c3
9b8d105
fa8812a
58c17d6
ab49651
393f02f
c192a22
7a45725
678ffbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # fix(dashboard): remove default active status filter from subscribers table (#2538) | ||
|
|
||
| ## Summary | ||
| Resolves #2538 by removing the pre-selected `status: ["active"]` filter on the subscribers data table so pending subscribers and newly configured pages are visible without requiring manual filter resets. | ||
|
|
||
| Closes #2538 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ import { | |
| upsertSelfSignupSubscriber, | ||
| verifySelfSignupSubscriber, | ||
| } from "@openstatus/services/page-subscriber"; | ||
| import { sendEmailVerification } from "@openstatus/subscriptions"; | ||
| import { TRPCError } from "@trpc/server"; | ||
| import { endOfDay, startOfDay, subDays } from "date-fns"; | ||
| import { z } from "zod"; | ||
|
|
@@ -1252,6 +1253,34 @@ export const statusPageRouter = createTRPCRouter({ | |
| }); | ||
| } | ||
|
|
||
| const baseUrl = _page.customDomain | ||
| ? `https://${_page.customDomain}` | ||
| : process.env.NEXT_PUBLIC_APP_URL | ||
| ? `${process.env.NEXT_PUBLIC_APP_URL}` | ||
| : `https://${_page.slug}.openstatus.dev`; | ||
| const verifyUrl = `${baseUrl}/verify/${subscription.token}`; | ||
|
|
||
| try { | ||
| await sendEmailVerification( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: A visitor now receives two subscription confirmation emails. This PR sends the verification email directly in Prompt for AI agents |
||
| { | ||
| id: subscription.id, | ||
| pageId: _page.id, | ||
| pageName: _page.title || _page.slug, | ||
| pageSlug: _page.slug, | ||
| channelType: "email", | ||
| email: opts.input.email, | ||
| token: subscription.token, | ||
| componentIds: opts.input.subscribeComponents | ||
| ? opts.input.pageComponents | ||
| : [], | ||
| customDomain: _page.customDomain, | ||
| }, | ||
| verifyUrl, | ||
| ); | ||
| } catch (err) { | ||
| console.error("Failed to send subscription verification email:", err); | ||
| } | ||
|
|
||
| return { id: subscription.id, token: subscription.token }; | ||
| }), | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.