-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #283 from midday-ai/feature/invoice-emails
Invoice Emails
- Loading branch information
Showing
8 changed files
with
402 additions
and
4 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
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
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { | ||
Body, | ||
Button, | ||
Container, | ||
Font, | ||
Heading, | ||
Html, | ||
Preview, | ||
Section, | ||
Tailwind, | ||
Text, | ||
} from "@react-email/components"; | ||
import { Footer } from "../components/footer"; | ||
import { Logo } from "../components/logo"; | ||
|
||
interface WelcomeProps { | ||
invoiceNumber: string; | ||
link: string; | ||
} | ||
|
||
const baseUrl = | ||
process.env.VERCEL_ENV === "production" | ||
? "https://midday.ai/email" | ||
: "http://localhost:3000/email"; | ||
|
||
export const InvoiceCommentEmail = ({ | ||
invoiceNumber = "INV-0001", | ||
link = "https://app.midday.ai/i/1234567890", | ||
}: WelcomeProps) => { | ||
const text = `New comment on Invoice ${invoiceNumber}`; | ||
|
||
return ( | ||
<Html> | ||
<Tailwind> | ||
<head> | ||
<Font | ||
fontFamily="Geist" | ||
fallbackFontFamily="Helvetica" | ||
webFont={{ | ||
url: "https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/files/geist-sans-latin-400-normal.woff2", | ||
format: "woff2", | ||
}} | ||
fontWeight={400} | ||
fontStyle="normal" | ||
/> | ||
|
||
<Font | ||
fontFamily="Geist" | ||
fallbackFontFamily="Helvetica" | ||
webFont={{ | ||
url: "https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/files/geist-sans-latin-500-normal.woff2", | ||
format: "woff2", | ||
}} | ||
fontWeight={500} | ||
fontStyle="normal" | ||
/> | ||
</head> | ||
<Preview>{text}</Preview> | ||
|
||
<Body className="bg-[#fff] my-auto mx-auto font-sans"> | ||
<Container | ||
className="border-transparent md:border-[#E8E7E1] my-[40px] mx-auto p-[20px] max-w-[600px]" | ||
style={{ borderStyle: "solid", borderWidth: 1 }} | ||
> | ||
<Logo baseUrl={baseUrl} /> | ||
<Heading className="text-[#121212] text-[21px] font-normal text-center p-0 my-[30px] mx-0"> | ||
New comment on Invoice <br /> {invoiceNumber} | ||
</Heading> | ||
|
||
<br /> | ||
|
||
<Text className="text-[#121212]"> | ||
Check the latest update on your invoice and respond directly by | ||
viewing the invoice. | ||
</Text> | ||
|
||
<Section className="text-center mt-[50px] mb-[50px]"> | ||
<Button | ||
className="bg-transparent text-primary text-[14px] text-[#121212] font-medium no-underline text-center px-6 py-3 border border-solid border-[#121212]" | ||
href={link} | ||
> | ||
View invoice | ||
</Button> | ||
</Section> | ||
|
||
<br /> | ||
|
||
<Footer baseUrl={baseUrl} /> | ||
</Container> | ||
</Body> | ||
</Tailwind> | ||
</Html> | ||
); | ||
}; | ||
|
||
export default InvoiceCommentEmail; |
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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import { | ||
Body, | ||
Button, | ||
Container, | ||
Font, | ||
Heading, | ||
Html, | ||
Preview, | ||
Section, | ||
Tailwind, | ||
Text, | ||
} from "@react-email/components"; | ||
import { Footer } from "../components/footer"; | ||
import { Logo } from "../components/logo"; | ||
|
||
interface WelcomeProps { | ||
companyName: string; | ||
teamName: string; | ||
invoiceNumber: string; | ||
link: string; | ||
} | ||
|
||
const baseUrl = | ||
process.env.VERCEL_ENV === "production" | ||
? "https://midday.ai/email" | ||
: "http://localhost:3000/email"; | ||
|
||
export const InvoiceOverdueEmail = ({ | ||
companyName = "Customer", | ||
teamName = "Midday", | ||
invoiceNumber = "INV-0001", | ||
link = "https://app.midday.ai/i/1234567890", | ||
}: WelcomeProps) => { | ||
const firstName = companyName.split(" ").at(0); | ||
const text = `Invoice ${invoiceNumber} from ${teamName} is Overdue`; | ||
|
||
return ( | ||
<Html> | ||
<Tailwind> | ||
<head> | ||
<Font | ||
fontFamily="Geist" | ||
fallbackFontFamily="Helvetica" | ||
webFont={{ | ||
url: "https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/files/geist-sans-latin-400-normal.woff2", | ||
format: "woff2", | ||
}} | ||
fontWeight={400} | ||
fontStyle="normal" | ||
/> | ||
|
||
<Font | ||
fontFamily="Geist" | ||
fallbackFontFamily="Helvetica" | ||
webFont={{ | ||
url: "https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/files/geist-sans-latin-500-normal.woff2", | ||
format: "woff2", | ||
}} | ||
fontWeight={500} | ||
fontStyle="normal" | ||
/> | ||
</head> | ||
<Preview>{text}</Preview> | ||
|
||
<Body className="bg-[#fff] my-auto mx-auto font-sans"> | ||
<Container | ||
className="border-transparent md:border-[#E8E7E1] my-[40px] mx-auto p-[20px] max-w-[600px]" | ||
style={{ borderStyle: "solid", borderWidth: 1 }} | ||
> | ||
<Logo baseUrl={baseUrl} /> | ||
<Heading className="text-[#121212] text-[21px] font-normal text-center p-0 my-[30px] mx-0"> | ||
Invoice {invoiceNumber} <br /> | ||
from {teamName} is Overdue | ||
</Heading> | ||
|
||
<br /> | ||
|
||
<span className="font-medium">Hi {firstName},</span> | ||
<Text className="text-[#121212]"> | ||
Please settle your payment as soon as possible to avoid further | ||
delay. If anything is unclear, feel free to add a comment by | ||
viewing the invoice. | ||
</Text> | ||
|
||
<Section className="text-center mt-[50px] mb-[50px]"> | ||
<Button | ||
className="bg-transparent text-primary text-[14px] text-[#121212] font-medium no-underline text-center px-6 py-3 border border-solid border-[#121212]" | ||
href={link} | ||
> | ||
View invoice | ||
</Button> | ||
</Section> | ||
|
||
<br /> | ||
|
||
<Footer baseUrl={baseUrl} /> | ||
</Container> | ||
</Body> | ||
</Tailwind> | ||
</Html> | ||
); | ||
}; | ||
|
||
export default InvoiceOverdueEmail; |
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { | ||
Body, | ||
Button, | ||
Container, | ||
Font, | ||
Heading, | ||
Html, | ||
Preview, | ||
Section, | ||
Tailwind, | ||
Text, | ||
} from "@react-email/components"; | ||
import { Footer } from "../components/footer"; | ||
import { Logo } from "../components/logo"; | ||
|
||
interface WelcomeProps { | ||
invoiceNumber: string; | ||
link: string; | ||
} | ||
|
||
const baseUrl = | ||
process.env.VERCEL_ENV === "production" | ||
? "https://midday.ai/email" | ||
: "http://localhost:3000/email"; | ||
|
||
export const InvoicePaidEmail = ({ | ||
invoiceNumber = "INV-0001", | ||
link = "https://app.midday.ai/i/1234567890", | ||
}: WelcomeProps) => { | ||
const text = `New comment on Invoice ${invoiceNumber}`; | ||
|
||
return ( | ||
<Html> | ||
<Tailwind> | ||
<head> | ||
<Font | ||
fontFamily="Geist" | ||
fallbackFontFamily="Helvetica" | ||
webFont={{ | ||
url: "https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/files/geist-sans-latin-400-normal.woff2", | ||
format: "woff2", | ||
}} | ||
fontWeight={400} | ||
fontStyle="normal" | ||
/> | ||
|
||
<Font | ||
fontFamily="Geist" | ||
fallbackFontFamily="Helvetica" | ||
webFont={{ | ||
url: "https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/files/geist-sans-latin-500-normal.woff2", | ||
format: "woff2", | ||
}} | ||
fontWeight={500} | ||
fontStyle="normal" | ||
/> | ||
</head> | ||
<Preview>{text}</Preview> | ||
|
||
<Body className="bg-[#fff] my-auto mx-auto font-sans"> | ||
<Container | ||
className="border-transparent md:border-[#E8E7E1] my-[40px] mx-auto p-[20px] max-w-[600px]" | ||
style={{ borderStyle: "solid", borderWidth: 1 }} | ||
> | ||
<Logo baseUrl={baseUrl} /> | ||
<Heading className="text-[#121212] text-[21px] font-normal text-center p-0 my-[30px] mx-0"> | ||
Invoice {invoiceNumber} <br /> has been Paid | ||
</Heading> | ||
|
||
<br /> | ||
|
||
<Text className="text-[#121212]"> | ||
We’ve received confirmation that your invoice has been | ||
successfully settled and it's automatically reconciled against | ||
your transaction. | ||
</Text> | ||
|
||
<Section className="text-center mt-[50px] mb-[50px]"> | ||
<Button | ||
className="bg-transparent text-primary text-[14px] text-[#121212] font-medium no-underline text-center px-6 py-3 border border-solid border-[#121212]" | ||
href={link} | ||
> | ||
View invoice | ||
</Button> | ||
</Section> | ||
|
||
<br /> | ||
|
||
<Footer baseUrl={baseUrl} /> | ||
</Container> | ||
</Body> | ||
</Tailwind> | ||
</Html> | ||
); | ||
}; | ||
|
||
export default InvoicePaidEmail; |
Oops, something went wrong.