Skip to content

Open-source status page, incident response and uptime monitoring

πŸ’Œ more follow up email (#695)

Thibault Le Ouay69dcc5055468
diff --git a/apps/web/src/app/api/internal/email/route.ts b/apps/web/src/app/api/internal/email/route.ts
new file mode 100644
index 000000000..f02cc737d
--- /dev/null
+++ b/apps/web/src/app/api/internal/email/route.ts
@@ -0,0 +1,36 @@
+import type { NextRequest } from "next/server";
+
+import { and, gte, lte } from "@openstatus/db";
+import { db } from "@openstatus/db/src/db";
+import { user } from "@openstatus/db/src/schema";
+import { FollowUpEmail, sendEmail } from "@openstatus/emails";
+
+export async function GET(request: NextRequest) {
+ const authHeader = request.headers.get("authorization");
+ if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
+ return new Response("Unauthorized", {
+ status: 401,
+ });
+ }
+
+ const date1 = new Date();
+ date1.setDate(date1.getDate() - 3);
+ const date2 = new Date();
+ date2.setDate(date2.getDate() - 3);
+ const users = await db
+ .select()
+ .from(user)
+ .where(and(gte(user.createdAt, date1), lte(user.createdAt, date2)))
+ .all();
+ for (const user of users) {
+ if (user.email) {
+ await sendEmail({
+ from: "Thibault Le Ouay Ducasse <[email protected]>",
+ subject: "Level up your website and API monitoring.",
+ to: [user.email],
+ react: FollowUpEmail(),
+ });
+ }
+ }
+ return Response.json({ success: true });
+}
diff --git a/apps/web/src/components/marketing/hero.tsx b/apps/web/src/components/marketing/hero.tsx
index df656b24b..d0d19aa52 100644
--- a/apps/web/src/components/marketing/hero.tsx
+++ b/apps/web/src/components/marketing/hero.tsx
@@ -33,8 +33,9 @@ export function Hero() {
A better way to monitor your services.
</h1>
<p className="text-muted-foreground mx-auto max-w-md text-lg md:max-w-lg md:text-xl">
- Monitor your API and website globally. Receive notifications before
- your users alert you.
+ Monitor your API and website from 6 continents, detect some
+ performance issues and receive notifications before your users are
+ affected.
</p>
</div>
<div className="my-4 grid gap-2 sm:grid-cols-2">
diff --git a/packages/api/src/router/clerk/webhook.ts b/packages/api/src/router/clerk/webhook.ts
index 5d6e42a1a..148174c07 100644
--- a/packages/api/src/router/clerk/webhook.ts
+++ b/packages/api/src/router/clerk/webhook.ts
@@ -69,7 +69,7 @@ export const webhookRouter = createTRPCRouter({
await sendEmail({
from: "Thibault Le Ouay Ducasse <[email protected]>",
- subject: "Welcome to OpenStatus.dev πŸ‘‹",
+ subject: "Level up your website and API monitoring.",
to: [opts.input.data.data.email_addresses[0].email_address],
react: WelcomeEmail(),
});
diff --git a/packages/emails/emails/followup.tsx b/packages/emails/emails/followup.tsx
new file mode 100644
index 000000000..3c21f2c09
--- /dev/null
+++ b/packages/emails/emails/followup.tsx
@@ -0,0 +1,40 @@
+import { Body, Head, Html, Link, Preview } from "@react-email/components";
+
+const FollowUpEmail = () => {
+ return (
+ <Html>
+ <Head>
+ <title>How's it going with OpenStatus?</title>
+ <Preview>How's it going with OpenStatus?</Preview>
+ <Body>
+ Hey
+ <br />
+ <br />
+ How’s everything going with Tinybird so far? Let me know if you run
+ into any issues, or have any feedback, good or bad!
+ <br />
+ <br />
+ Feel free to shoot me an email or schedule a call with me here:
+ <a href="https://cal.com/team/openstatus/30min">
+ https://cal.com/team/openstatus/30min
+ </a>
+ .
+ <br />
+ <br />
+ Thank you,
+ <br />
+ <br />
+ Thibault Le Ouay Ducasse
+ <br />
+ <br />⭐ Star us on{" "}
+ <Link href="https://github.com/openstatushq/openstatus">GitHub</Link>
+ <br />
+ πŸš€ Visit our website{" "}
+ <Link href="https://www.openstatus.dev">OpenStatus.dev</Link>
+ </Body>
+ </Head>
+ </Html>
+ );
+};
+
+export { FollowUpEmail };
diff --git a/packages/emails/emails/welcome.tsx b/packages/emails/emails/welcome.tsx
index 9acfa7666..bc9d78e7a 100644
--- a/packages/emails/emails/welcome.tsx
+++ b/packages/emails/emails/welcome.tsx
@@ -4,22 +4,43 @@ const WelcomeEmail = () => {
return (
<Html>
<Head>
- <title>Welcome to OpenStatus.dev πŸ‘‹</title>
- <Preview>Welcome to OpenStatus.dev πŸ‘‹</Preview>
+ <title>Level up your website and API monitoring.</title>
+ <Preview>Take the most of your OpenStatus monitoring</Preview>
<Body>
- Hey!
+ Hey πŸ‘‹
<br />
<br />
- Welcome to OpenStatus.dev! We're excited to have you on board.
- <br /> I hope you will enjoy using our product as much as we enjoyed
- building it.
+ I'm Thibault <a href="https://www.openstatus.dev">OpenStatus</a>{" "}
+ co-founder.
<br />
+ <br /> I'm thrilled to see you joining us. We are building an
+ open-source status page and monitoring tool. We are here to help you
+ monitor your websites and API to get notified before your users alert
+ you.
<br />
- What kind of apps are going to monitor?
<br />
- How do you handle your incidents?
+ Here are a few things you can do with OpenStatus:
+ <br />- Use our{" "}
+ <a href="https://docs.openstatus.dev/packages/terraform">
+ Terraform providers
+ </a>{" "}
+ to manage your monitors
+ <br />- Integrate your status within your application with our{" "}
+ <a href="https://docs.openstatus.dev/packages/status-widget">
+ API
+ </a>{" "}
+ and{" "}
+ <a href="https://docs.openstatus.dev/packages/react">React Widget</a>
+ <br />- Build your own status page with our <a href="">API</a> and
+ host it where you want. Here's our{" "}
+ <a href="https://github.com/openstatusHQ/astro-status-page">
+ Astro template
+ </a>{" "}
+ that you can easily host on CloudFlare
<br />
<br />
+ If you have any questions, just let me know.
+ <br />
Thank you,
<br />
<br />
@@ -36,4 +57,4 @@ const WelcomeEmail = () => {
);
};
-export default WelcomeEmail;
+export { WelcomeEmail };
diff --git a/packages/emails/index.ts b/packages/emails/index.ts
index 2318537fd..f38475002 100644
--- a/packages/emails/index.ts
+++ b/packages/emails/index.ts
@@ -1,8 +1,9 @@
import { Alert, EmailDataSchema } from "./emails/alert";
+import { FollowUpEmail } from "./emails/followup";
import SubscribeEmail from "./emails/subscribe";
import { validateEmailNotDisposable } from "./emails/utils/utils";
import WaitingList from "./emails/waiting-list";
-import WelcomeEmail from "./emails/welcome";
+import { WelcomeEmail } from "./emails/welcome";
export {
WelcomeEmail,
@@ -11,6 +12,7 @@ export {
Alert,
EmailDataSchema,
SubscribeEmail,
+ FollowUpEmail,
};
export { sendEmail, sendEmailHtml } from "./emails/send";