Replies: 2 comments 1 reply
-
Ruby on rails has this idea/concept (although with a different implementation) for their action-mailer gem. https://guides.rubyonrails.org/action_mailer_basics.html#previewing-and-testing-mailers
class UserMailerPreview < ActionMailer::Preview
def welcome_email
UserMailer.with(user: User.first).welcome_email
end
end |
Beta Was this translation helpful? Give feedback.
-
We already have it implemented as export const EmailTemplate = ...
EmailTemplate.PreviewProps = {...} Here's the docs for it https://react.email/docs/cli#how-can-i-define-props-specific-to-the-emails-preview |
Beta Was this translation helpful? Give feedback.
-
Goals
Populate email templates with sample data without using default props on the email template component.
Background
It'd like to have sample data for developing a template without using default values in the function arguments e.g.
EmailTemplate({name}: EmailTemplateProps = { name: 'John Smith' })
.Proposal
Beta Was this translation helpful? Give feedback.
All reactions