File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ icon: 'square-terminal'
1010
1111Starts a local development server that will watch your files and automatically rebuild your email when you make changes.
1212
13- ### Where can I place my static files for previewing
13+ ### Where can I place my static files for previewing?
1414
1515Almost always you will need to have static files in your emails, and seeing
1616them on the preview server without having to first host on a CDN is very helpful.
@@ -60,7 +60,29 @@ export default Email(props) {
6060
6161You can refer to our [ demo emails source code] ( https://demo.react.email/preview/vercel-invite-user.tsx?view=source ) for an example of how we do this.
6262
63- ### How to make the preview server ignore directories
63+ ### How can I define props specific to the email's preview?
64+
65+ Considering that you are already default exporting the React component
66+ that will render as your email template, you can just define a ` PreviewProps ` with it as follows:
67+
68+ ``` jsx
69+ export default Email (props) {
70+ return (
71+ < div>
72+ < a src= {props .source }> click here if you want candy 👀< / a>
73+ < / div>
74+ )
75+ }
76+
77+ Email .PreviewProps = {
78+ source: ' https://www.youtube.com/watch?v=dQw4w9WgXcQ'
79+ }
80+ ```
81+
82+ And then when opening this email's preview the ` PreviewProps `
83+ will be used as props into Email.
84+
85+ ### How to make the preview server ignore directories?
6486
6587Once the preview server has started and is now open on ` localhost ` , the preview server
6688reads recursively down into all of your files and directories. This can be disabled
You can’t perform that action at this time.
0 commit comments