React Email
Use React Email to author component-based templates, render to HTML, then send with the Xurel SDK.
Install
npm
npm install xurel @react-email/components react-emailRender & send
send.tsx
import { render } from '@react-email/render';
import { Xurel } from 'xurel';
import { WelcomeEmail } from './emails/WelcomeEmail';
const xurel = new Xurel(process.env.XUREL_API_KEY!);
const html = await render(WelcomeEmail({ firstName: 'Ayu' }));
await xurel.emails.send({
from: 'hello@yourdomain.com',
to: 'ayu@example.com',
subject: 'Welcome',
html,
type: 'transactional',
});