-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
if no links are found in daily digest, prompt user to reconnect
- Loading branch information
1 parent
da19ad1
commit 64c9d17
Showing
5 changed files
with
89 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,22 +19,42 @@ const RSSLinks = ({ links, name, digestUrl }: RSSLinksProps) => { | |
|
||
return ( | ||
<article> | ||
<Heading as="h1">{today}</Heading> | ||
<Text as="p">{intro(name)}</Text> | ||
<Text as="p">{linkPlug(digestUrl)}</Text> | ||
<Text as="p"> | ||
<hr /> | ||
</Text> | ||
{links.map((linkPost, i) => ( | ||
<RSSLinkPost | ||
key={linkPost.link?.url} | ||
linkPost={linkPost} | ||
digestUrl={digestUrl} | ||
/> | ||
))} | ||
<Text as="p"> | ||
<Link href="https://sill.social/links">See all links on Sill</Link> | ||
</Text> | ||
{links.length === 0 ? ( | ||
<> | ||
<Heading as="h1">Oops, no links!</Heading> | ||
<Text as="p"> | ||
It looks like Sill doesn't have any links for you. This is likely | ||
because Sill got out of sync with your Bluesky and/or Mastodon | ||
accounts. To address this,{" "} | ||
<Link href="https://sill.social">log back into Sill</Link>. You may | ||
be redirected to Bluesky or Mastodon to reauthorize Sill. | ||
</Text> | ||
<Text as="p"> | ||
If this doesn't work for you, please email{" "} | ||
<Link href="mailto:[email protected]">[email protected]</Link>. | ||
</Text> | ||
</> | ||
) : ( | ||
<> | ||
<Heading as="h1">{today}</Heading> | ||
<Text as="p">{intro(name)}</Text> | ||
<Text as="p">{linkPlug(digestUrl)}</Text> | ||
<Text as="p"> | ||
<hr /> | ||
</Text> | ||
{links.map((linkPost, i) => ( | ||
<RSSLinkPost | ||
key={linkPost.link?.url} | ||
linkPost={linkPost} | ||
digestUrl={digestUrl} | ||
/> | ||
))} | ||
<Text as="p"> | ||
<Link href="https://sill.social/links">See all links on Sill</Link> | ||
</Text> | ||
</> | ||
)} | ||
|
||
<Text as="p">{digestOutro("https://sill.social/email")}</Text> | ||
</article> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Button, Heading, Hr, Text } from "@react-email/components"; | ||
import { Button, Heading, Hr, Link, Text } from "@react-email/components"; | ||
import EmailLayout from "~/components/emails/Layout"; | ||
import LinkPost from "~/components/emails/LinkPost"; | ||
import { | ||
|
@@ -27,26 +27,45 @@ const TopLinks = ({ links, name, digestUrl, layout }: TopLinksProps) => { | |
|
||
return ( | ||
<EmailLayout preview={preview(links)}> | ||
<Heading as="h1">{title}</Heading> | ||
<Heading as="h3" style={date}> | ||
{today} | ||
</Heading> | ||
<Text>{intro(name)}</Text> | ||
<Text>{linkPlug(digestUrl)}</Text> | ||
{links.map((linkPost, i) => ( | ||
{links.length === 0 ? ( | ||
<> | ||
<LinkPost | ||
key={linkPost.link?.url} | ||
linkPost={linkPost} | ||
digestUrl={digestUrl} | ||
layout={layout} | ||
/> | ||
{i < links.length - 1 && <Hr style={hr(layout)} />} | ||
<Heading as="h1">Oops, no links!</Heading> | ||
<Text> | ||
It looks like Sill doesn't have any links for you. This is likely | ||
because Sill got out of sync with your Bluesky and/or Mastodon | ||
accounts. To address this,{" "} | ||
<Link href="https://sill.social">log back into Sill</Link>. You may | ||
be redirected to Bluesky or Mastodon to reauthorize Sill. | ||
</Text> | ||
<Text> | ||
If this doesn't work for you, please email{" "} | ||
<Link href="mailto:[email protected]">[email protected]</Link>. | ||
</Text> | ||
</> | ||
))} | ||
<Button href="https://sill.social/links" style={button}> | ||
See all links on Sill | ||
</Button> | ||
) : ( | ||
<> | ||
<Heading as="h1">{title}</Heading> | ||
<Heading as="h3" style={date}> | ||
{today} | ||
</Heading> | ||
<Text>{intro(name)}</Text> | ||
<Text>{linkPlug(digestUrl)}</Text> | ||
{links.map((linkPost, i) => ( | ||
<> | ||
<LinkPost | ||
key={linkPost.link?.url} | ||
linkPost={linkPost} | ||
digestUrl={digestUrl} | ||
layout={layout} | ||
/> | ||
{i < links.length - 1 && <Hr style={hr(layout)} />} | ||
</> | ||
))} | ||
<Button href="https://sill.social/links" style={button}> | ||
See all links on Sill | ||
</Button> | ||
</> | ||
)} | ||
<Text>{digestOutro("https://sill.social/email")}</Text> | ||
</EmailLayout> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ export const loader = async ({ request }: Route.LoaderArgs) => { | |
const emailBody = { | ||
from: "Sill <[email protected]>", | ||
to: dbUser.email, | ||
subject: subject, | ||
subject: links.length === 0 ? "No links found" : subject, | ||
"o:tag": "digest", | ||
...(await renderReactEmail( | ||
<TopLinks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters