diff --git a/client/src/blog/index.tsx b/client/src/blog/index.tsx index 6186bf32849b..063bc7a0ecd7 100644 --- a/client/src/blog/index.tsx +++ b/client/src/blog/index.tsx @@ -10,7 +10,6 @@ import { BlogImage, BlogPostMetadata } from "../../../libs/types/blog.js"; import "./index.scss"; import { Button } from "../ui/atoms/button"; -import { SignUpSection as NewsletterSignUp } from "../newsletter"; interface BlogIndexData { posts: BlogPostMetadata[]; @@ -105,7 +104,6 @@ function BlogIndex(props: HydrationData) { })} - ); } diff --git a/client/src/blog/post.tsx b/client/src/blog/post.tsx index 4f817184489b..d01c757f7087 100644 --- a/client/src/blog/post.tsx +++ b/client/src/blog/post.tsx @@ -16,7 +16,6 @@ import { } from "../../../libs/types/blog"; import { useDecorateCodeExamples, useRunSample } from "../document/hooks"; import { DEFAULT_LOCALE } from "../../../libs/constants"; -import { SignUpSection as NewsletterSignUp } from "../newsletter"; import { TOC } from "../document/organisms/toc"; import { SidePlacement } from "../ui/organisms/placement"; import { PlayQueue } from "../playground/queue"; @@ -211,7 +210,6 @@ export function BlogPost(props: HydrationData) { {blogMeta.links && } - )} diff --git a/client/src/newsletter/index.tsx b/client/src/newsletter/index.tsx index 773bd959f5f8..6c6ae6ed4f8d 100644 --- a/client/src/newsletter/index.tsx +++ b/client/src/newsletter/index.tsx @@ -1,7 +1,6 @@ -import React, { createElement, useState } from "react"; +import React, { createElement } from "react"; import { useIsServer, useLocale } from "../hooks"; -import { Button } from "../ui/atoms/button"; import { MainContentContainer } from "../ui/atoms/page-content"; import { useUserData } from "../user-context"; @@ -10,7 +9,7 @@ import "./index.scss"; export function Newsletter() { return ( - + ); } @@ -19,98 +18,25 @@ function SignUpForm({ sendUsersToSettings = false, section = false }) { const isServer = useIsServer(); const user = useUserData(); const locale = useLocale(); - const [pending, setPending] = useState(false); - const [error, setError] = useState(false); - const [submitted, setSubmitted] = useState(false); - const [email, setEmail] = useState(""); - const submit = async (event: React.FormEvent) => { - event.preventDefault(); - setPending(true); - try { - const response = await fetch("/api/v1/newsletter", { - body: JSON.stringify({ email }), - method: "POST", - headers: { - "content-type": "application/json", - }, - }); - if (!response.ok) { - throw Error(); - } - } catch { - setError(true); - setPending(false); - return; - } - setSubmitted(true); - }; - return submitted ? ( - <> - {createElement(section ? "h2" : "h1", null, "Thanks!")} -

- If you haven't previously confirmed a subscription to a Mozilla-related - newsletter, you may have to do so. Please check your inbox or your spam - filter for an email from us. -

- - ) : ( + return ( <> {createElement(section ? "h2" : "h1", null, "Stay Informed with MDN")} +

We're decommissioning our MDN Plus newsletter.

- Get the MDN newsletter and never miss an update on the latest web - development trends, tips, and best practices. + + We will automatically unsubscribe you and purge all related data soon. +

{sendUsersToSettings && user?.isAuthenticated && !isServer ? (

- Sign up via the{" "} + Unsubscribe now via the{" "} Settings Page.

) : ( -
-
- - - setEmail(e.target.value)} - disabled={pending} - /> -
- -
- -
- -
- -
-
+ <> )} ); diff --git a/client/src/settings/newsletter.tsx b/client/src/settings/newsletter.tsx index fd05474e87b7..87d5593c64f8 100644 --- a/client/src/settings/newsletter.tsx +++ b/client/src/settings/newsletter.tsx @@ -28,14 +28,28 @@ export default function Newsletter() {
  • -

    MDN Plus Newsletter

    +

    + MDN Plus Newsletter (Deprecated) +

    - Allow us to email you product updates, news, and more. + We're decommissioning our MDN Plus newsletter. + {enabled ? ( + <> + {" "} + If you unsubscribe, you cannot subscribe again.
    + + We will automatically unsubscribe you and purge all + related data soon. + + + ) : ( + <> + )}
    {loading ? ( - ) : ( + ) : enabled ? ( + ) : ( + <> )}