RB19
RB19

Reputation: 169

How to create email templates in React JS using Rails as backend

Has anyone have any idea to create email templates in React JS using Rails as backend

Upvotes: 0

Views: 442

Answers (1)

Ibraheem Zafar
Ibraheem Zafar

Reputation: 346

Please use this plugin

npm install react-html-email

To render a simple email:

import { Email, Item, Span, A, renderEmail } from 'react-html-email'
const emailHTML = renderEmail(
<Email title="Hello World!">
  <Item align="center">
    <Span fontSize={20}>
      This is an example email made with:
      <A href="#">react-html- 
        email</A>.
    </Span>
  </Item>
</Email>
)

Upvotes: 3

Related Questions