diff --git a/ghost/portal/src/components/common/NewsletterManagement.js b/ghost/portal/src/components/common/NewsletterManagement.js index d876117c80..cf8f12c767 100644 --- a/ghost/portal/src/components/common/NewsletterManagement.js +++ b/ghost/portal/src/components/common/NewsletterManagement.js @@ -110,6 +110,7 @@ function ShowPaidMemberMessage({site, isPaid}) { } export default function NewsletterManagement({ + notification, subscribedNewsletters, updateSubscribedNewsletters, unsubscribeAll, @@ -117,10 +118,15 @@ export default function NewsletterManagement({ }) { const isDisabled = !subscribedNewsletters?.length; const {brandColor, site} = useContext(AppContext); + const EmptyNotification = () => { + return null; + }; + const FinalNotification = notification || EmptyNotification; return (
+
{ return d.subscribe_on_signup; }); + const [hasInteracted, setHasInteracted] = useState(false); const [subscribedNewsletters, setSubscribedNewsletters] = useState(defaultNewsletters); const [showPrefs, setShowPrefs] = useState(false); @@ -115,14 +116,28 @@ export default function UnsubscribePage() {
); } + + const HeaderNotification = () => { + const unsubscribedNewsletter = siteNewsletters?.find((d) => { + return d.uuid === pageData.newsletterUuid; + }); + const hideClassName = hasInteracted ? 'hide' : ''; + return ( +

{member?.email} will no longer receive {unsubscribedNewsletter?.name} newsletter.

+ ); + }; + return ( { setSubscribedNewsletters(newsletters); + setHasInteracted(true); await api.member.updateNewsletters({uuid: pageData.uuid, newsletters}); }} unsubscribeAll={async () => { + setHasInteracted(true); setSubscribedNewsletters([]); onAction('showPopupNotification', { action: 'updated:success',