-
Notifications
You must be signed in to change notification settings - Fork 172
feat(emails): send 'Your data is ready!' email after ingest completes #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tifa2UP
wants to merge
2
commits into
main
Choose a base branch
from
feat/data-ready-email
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
68 changes: 68 additions & 0 deletions
68
packages/emails/src/templates/data-processing-failed-email.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { Heading, Section, Text } from "@react-email/components"; | ||
|
|
||
| import { Button } from "../components/button"; | ||
| import { DefaultLayout } from "../components/default-layout"; | ||
|
|
||
| export function DataProcessingFailedEmail({ | ||
| email = "john@doe.com", | ||
| namespace = { | ||
| name: "My Namespace", | ||
| slug: "my-namespace", | ||
| }, | ||
| organization = { | ||
| name: "Acme, Inc", | ||
| slug: "acme", | ||
| }, | ||
| error = "Failed to process documents", | ||
| domain = "https://app.agentset.ai", | ||
| }: { | ||
| email: string; | ||
| namespace: { | ||
| name: string; | ||
| slug: string; | ||
| }; | ||
| organization: { | ||
| name: string; | ||
| slug: string; | ||
| }; | ||
| error: string; | ||
| domain?: string; | ||
| }) { | ||
| return ( | ||
| <DefaultLayout | ||
| preview="There was an issue processing your data" | ||
| footer={{ email, domain }} | ||
| > | ||
| <Heading className="mx-0 my-7 p-0 text-xl font-medium text-black"> | ||
| There was an issue processing your data | ||
| </Heading> | ||
|
|
||
| <Text className="text-sm leading-6 text-black"> | ||
| <strong>{namespace.name}</strong> on{" "} | ||
| <a href="https://agentset.ai" className="text-black underline"> | ||
| agentset.ai | ||
| </a>{" "} | ||
| ran into an issue while processing your data. | ||
| </Text> | ||
|
|
||
| <Text className="text-sm leading-6 text-black"> | ||
| <strong>Error:</strong> {error} | ||
| </Text> | ||
|
|
||
| <Text className="text-sm leading-6 text-black"> | ||
| Head over to your documents page to review the details and retry if | ||
| needed. | ||
| </Text> | ||
|
|
||
| <Section className="my-6"> | ||
| <Button | ||
| href={`${domain}/${organization.slug}/${namespace.slug}/documents`} | ||
| > | ||
| View Documents | ||
| </Button> | ||
| </Section> | ||
| </DefaultLayout> | ||
| ); | ||
| } | ||
|
|
||
| export default DataProcessingFailedEmail; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| import { Heading, Section, Text } from "@react-email/components"; | ||
|
|
||
| import { Button } from "../components/button"; | ||
| import { DefaultLayout } from "../components/default-layout"; | ||
|
|
||
| export function DataReadyEmail({ | ||
| email = "john@doe.com", | ||
| namespace = { | ||
| name: "My Namespace", | ||
| slug: "my-namespace", | ||
| }, | ||
| organization = { | ||
| name: "Acme, Inc", | ||
| slug: "acme", | ||
| }, | ||
| domain = "https://app.agentset.ai", | ||
| }: { | ||
| email: string; | ||
| namespace: { | ||
| name: string; | ||
| slug: string; | ||
| }; | ||
| organization: { | ||
| name: string; | ||
| slug: string; | ||
| }; | ||
| domain?: string; | ||
| }) { | ||
| return ( | ||
| <DefaultLayout preview="Your data is ready!" footer={{ email, domain }}> | ||
| <Heading className="mx-0 my-7 p-0 text-xl font-medium text-black"> | ||
| Your data is ready! | ||
| </Heading> | ||
|
|
||
| <Text className="text-sm leading-6 text-black"> | ||
| <strong>{namespace.name}</strong> on{" "} | ||
| <a href="https://agentset.ai" className="text-black underline"> | ||
| agentset.ai | ||
| </a>{" "} | ||
| just finished building your data. | ||
| </Text> | ||
|
|
||
| <Text className="text-sm leading-6 text-black"> | ||
| Jump in and start chatting. Tell your namespace what you want to find, | ||
| and get answers from your documents. | ||
| </Text> | ||
|
|
||
| <Text className="text-sm leading-6 text-black"> | ||
| A few tips to get you started: | ||
| </Text> | ||
|
|
||
| <Text className="ml-1 text-sm leading-4 text-black"> | ||
| ◆ Start small. Try one simple question first to see how it works. | ||
| </Text> | ||
|
|
||
| <Text className="ml-1 text-sm leading-4 text-black"> | ||
| ◆ Be specific. "What are the key findings?" beats "tell | ||
| me stuff." | ||
| </Text> | ||
|
|
||
| <Text className="ml-1 text-sm leading-4 text-black"> | ||
| ◆ Refine as you go. Follow up to dig deeper into any answer. | ||
| </Text> | ||
|
|
||
| <Section className="my-6"> | ||
| <Button | ||
| href={`${domain}/${organization.slug}/${namespace.slug}/playground`} | ||
| > | ||
| Open Playground | ||
| </Button> | ||
| </Section> | ||
| </DefaultLayout> | ||
| ); | ||
| } | ||
|
|
||
| export default DataReadyEmail; | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
organization.nameis accepted but never usedThe
organizationprop type declares bothnameandslug, butnameis never rendered anywhere in the template. Onlyorganization.slugis used to construct the playground URL. Carrying an unused field through the type signature can mislead future maintainers and requires callers to supply data unnecessarily.If there are no plans to display the organization name in this email, consider narrowing the type:
Context Used: Rule from
dashboard- Guidelines for writing clean, maintainable, and human-readable code. Apply these rules when writing ... (source)