-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Components with Multipart Emails (multiple formats) #1670
Comments
@jaredmoody I don't see why we couldn't support this. Mind opening a PR with a failing test to get us started? I'd be happy to pair with you on building this feature, send me an email with your availability: joelhawksley@github.com |
See our work in progress here: #1681. At this point, it looks like it will be too much work to land this any time soon. I'm tagging this issue as |
@jaredmoody @joelhawksley I am working on adding support for this by checking using |
@reeganviljoen sounds good, let me know what you think of our previous attempt 😄 |
@joelhawksley I looked at the previous attempt and it seemed solid, the only place where I differ is I believe the format should be assumed from the request |
@jaredmoody I have created a discussion around how view_component handles formats because their are similar feature requests, hopefully this will help shed light on implementing this feature |
I was trying to convert a partial that's used in my mailers to a ViewComponent today, and because the partial is used in a multipart email, it has a plaintext template (_thing.text.erb) as well as an html template (_thing.html.erb). I was surprised I could not define a component with two different template formats, I get the following error:
ViewComponent::TemplateError: More than one template found for Mailers::ThingComponent. There can only be one default template file per component.
Maybe I could workaround by using a variant?
It sure would be nice if this just worked out of the box the way that Rails does with different formats.
The text was updated successfully, but these errors were encountered: