-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(emails): add email template with wrapper (#1588)
* feat(emails): add header and footer Co-authored-by: Priya Chatwani <[email protected]> Co-authored-by: Hiemanshu Sharma <[email protected]>
- Loading branch information
1 parent
68fb0fa
commit 94fc8fa
Showing
7 changed files
with
837 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { MjmlColumn, MjmlSection, MjmlText } from "@faire/mjml-react"; | ||
import React from "react"; | ||
|
||
interface FooterProps { | ||
orgName: string; | ||
settingsUrl: string; | ||
} | ||
|
||
const Footer: React.FC<FooterProps> = ({ orgName, settingsUrl }) => { | ||
return ( | ||
<MjmlSection fullWidth> | ||
<MjmlColumn> | ||
<MjmlText> | ||
<p>© 2023 Rewired, LLC. All rights reserved.</p> | ||
<p> | ||
You are receiving this email because you signed up to text for{" "} | ||
{orgName} | ||
. | ||
<br /> | ||
<a href={settingsUrl}>Update</a> your preferences or unsubscribe{" "} | ||
<a href={settingsUrl}>here</a> | ||
. | ||
<br /> | ||
</p> | ||
<p> | ||
Rewired LLC <br /> | ||
41 Flatbush Ave Fl 1, PMB 731 <br /> | ||
Brooklyn, NY 11217 <br /> | ||
</p> | ||
</MjmlText> | ||
</MjmlColumn> | ||
</MjmlSection> | ||
); | ||
}; | ||
export default Footer; |
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,14 @@ | ||
import { MjmlColumn, MjmlImage, MjmlSection } from "@faire/mjml-react"; | ||
import React from "react"; | ||
|
||
const Header: React.FC = () => { | ||
return ( | ||
<MjmlSection fullWidth> | ||
<MjmlColumn> | ||
<MjmlImage src="https://i.imgur.com/xxxV8Jo.png" /> | ||
</MjmlColumn> | ||
</MjmlSection> | ||
); | ||
}; | ||
|
||
export default Header; |
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,53 @@ | ||
import { | ||
Mjml, | ||
MjmlAll, | ||
MjmlAttributes, | ||
MjmlBody, | ||
MjmlColumn, | ||
MjmlHead, | ||
MjmlSection, | ||
MjmlText | ||
} from "@faire/mjml-react"; | ||
import React from "react"; | ||
|
||
import Footer from "./footer"; | ||
import Header from "./header"; | ||
|
||
export interface TemplateWrapperProps { | ||
children: React.ReactNode; | ||
organizationName: string; | ||
settingsUrl: string; | ||
} | ||
|
||
export const TemplateWrapper: React.FC<TemplateWrapperProps> = ({ | ||
children, | ||
organizationName, | ||
settingsUrl | ||
}) => { | ||
return ( | ||
<Mjml> | ||
<MjmlHead> | ||
<MjmlAttributes> | ||
<MjmlAll fontFamily="Helvetica, Arial, sans-serif" /> | ||
<MjmlText | ||
fontWeight="400" | ||
fontSize="16px" | ||
color="#000000" | ||
lineHeight="24px" | ||
/> | ||
</MjmlAttributes> | ||
</MjmlHead> | ||
<MjmlBody> | ||
<Header /> | ||
<MjmlSection fullWidth backgroundColor="#f3f3f3"> | ||
<MjmlColumn> | ||
<MjmlText>{children}</MjmlText> | ||
</MjmlColumn> | ||
</MjmlSection> | ||
<Footer orgName={organizationName} settingsUrl={settingsUrl} /> | ||
</MjmlBody> | ||
</Mjml> | ||
); | ||
}; | ||
|
||
export default TemplateWrapper; |
Oops, something went wrong.