a tool for shared writing and social publishing
0

Configure Feed

Select the types of activity you want to include in your feed.

add pub name/link to subscribe email

Jared Pereira (Apr 27, 2026, 5:56 PM EDT) 2dc82233 cf41d6b3

+37 -11
+20 -8
actions/publications/subscribeEmail.tsx
··· 20 20 publishAtprotoSubscriptionForDid, 21 21 unsubscribeToPublication, 22 22 } from "app/lish/subscribeToPublication"; 23 + import { normalizePublicationRecord } from "src/utils/normalizeRecords"; 23 24 24 25 type RequestError = 25 26 | "invalid_email" ··· 38 39 const email = emailRaw.trim().toLowerCase(); 39 40 if (!EMAIL_REGEX.test(email)) return Err("invalid_email"); 40 41 41 - const [{ data: settings }, identity] = await Promise.all([ 42 - supabaseServerClient 43 - .from("publication_newsletter_settings") 44 - .select("enabled") 45 - .eq("publication", publicationUri) 46 - .maybeSingle(), 47 - getIdentityData(), 48 - ]); 42 + const [{ data: settings }, { data: publication }, identity] = 43 + await Promise.all([ 44 + supabaseServerClient 45 + .from("publication_newsletter_settings") 46 + .select("enabled") 47 + .eq("publication", publicationUri) 48 + .maybeSingle(), 49 + supabaseServerClient 50 + .from("publications") 51 + .select("record") 52 + .eq("uri", publicationUri) 53 + .maybeSingle(), 54 + getIdentityData(), 55 + ]); 49 56 if (!settings?.enabled) return Err("newsletter_disabled"); 57 + const normalizedPub = normalizePublicationRecord(publication?.record); 58 + const pubName = normalizedPub?.name; 59 + const pubUrl = normalizedPub?.url; 50 60 51 61 // Postmark suppression check: the broadcast stream is shared across all 52 62 // pubs, so a prior SpamComplaint or HardBounce on ANY publication blocks ··· 146 156 template: ( 147 157 <PubConfirmEmail 148 158 code={pendingCode} 159 + publicationName={pubName} 160 + publicationUrl={pubUrl} 149 161 assetsBaseUrl={process.env.NEXT_PUBLIC_APP_URL || "https://leaflet.pub"} 150 162 /> 151 163 ),
+17 -3
emails/pubConfirmEmail.tsx
··· 4 4 Container, 5 5 Html, 6 6 Img, 7 + Link, 7 8 Row, 8 9 Tailwind, 9 10 } from "@react-email/components"; ··· 18 19 export const PubConfirmEmail = (props: { 19 20 code?: string; 20 21 assetsBaseUrl?: string; 22 + publicationName?: string; 23 + publicationUrl?: string; 21 24 }) => { 22 25 const staticUrl = makeStaticUrl( 23 26 props.assetsBaseUrl ?? "https://leaflet.pub", ··· 48 51 <Column width={"8px"} /> 49 52 50 53 <Column> 51 - <Heading noPadding as="h2"> 52 - Leaflet Explorers 53 - </Heading> 54 + {props.publicationUrl ? ( 55 + <Link 56 + href={props.publicationUrl} 57 + className="!text-primary !no-underline" 58 + > 59 + <Heading noPadding as="h2"> 60 + {props.publicationName ?? "Leaflet Explorers"} 61 + </Heading> 62 + </Link> 63 + ) : ( 64 + <Heading noPadding as="h2"> 65 + {props.publicationName ?? "Leaflet Explorers"} 66 + </Heading> 67 + )} 54 68 </Column> 55 69 </Row> 56 70 <Text className="!mt-6 !mb-1 text-secondary">