Skip to content

Commit bfba625

Browse files
authored
fix: allow configuring the email body's styles (#2182)
1 parent ec19b21 commit bfba625

File tree

4 files changed

+45
-7
lines changed

4 files changed

+45
-7
lines changed

docs/content/docs/features/export/email.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ See the [full example](/examples/interoperability/converting-blocks-to-react-ema
5656
- **footer**: Add content to the bottom of the email (must be a React-Email compatible component)
5757
- **head**: Inject elements into the [Head element](https://react.email/docs/components/head)
5858
- **container**: Customize the container element (A component which will wrap the email content including the header and footer)
59+
- **bodyStyles**: Customize the body styles (a `CSSProperties` object), providing an object here will completely override the default styles with what you provide
5960

6061
Example usage:
6162

@@ -82,6 +83,14 @@ const html = await exporter.toReactEmailDocument(editor.document, {
8283
footer: <Text>Footer</Text>,
8384
head: <title>My email</title>,
8485
container: ({ children }) => <Container>{children}</Container>,
86+
// These are the default body styles that are set by default
87+
bodyStyles: {
88+
fontFamily:
89+
"'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif",
90+
fontSize: "16px",
91+
lineHeight: "1.5",
92+
color: "#333",
93+
},
8594
});
8695
```
8796

0 commit comments

Comments
 (0)