Skip to content
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

Render React Component (JSXConsructor) to Email Template #428

Open
AlbinoGeek opened this issue Nov 16, 2024 · 0 comments
Open

Render React Component (JSXConsructor) to Email Template #428

AlbinoGeek opened this issue Nov 16, 2024 · 0 comments

Comments

@AlbinoGeek
Copy link

Hello!

What is the expected/supported way to convert a React component to an email template to use with mailgun? It would appear competing solutions are much better suited for this, notably with Resend.js having the following:

{
  React: <MyComponent />
}

What I've tried so far (with various levels of failure):

ReactDOM.render(<Component />) // missing images, CSS breaks
ReactDOMServer.renderToString(<Component />) // missing images
ReactDOMServer.renderToStaticMarkup(<Component />) // missing images

Likewise, even if you manually load the images, string replace them in the rendered template with equiv; cid: references, many image types (most notably SVG) do not work whatsoever, displaying no src on the receiving side.

I'll repeat, with Resendjs, this "just works" including SVG images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant