// VerifyEmail.tsx (note the TSX extension)
import { renderToString } from "solid-js/web"
export const Email = (props: { url: string }) => {
return (
<html>
<body>
<h2>Onboarding</h2>
<p>
Click <a href={props.url}>here</a> to verify your email.
</p>
</body>
</html>
)
}
export const getEmailTemplate = (url: string) => renderToString(() => <Email url={url} />)
// sendVerificationEmail.ts
resendClient.emails.send({
from: 'Onboarding <[email protected]>',
to: user.email,
subject: 'Verify your email',
html: getEmailTemplate(url);
});
// VerifyEmail.tsx (note the TSX extension)
import { renderToString } from "solid-js/web"
export const Email = (props: { url: string }) => {
return (
<html>
<body>
<h2>Onboarding</h2>
<p>
Click <a href={props.url}>here</a> to verify your email.
</p>
</body>
</html>
)
}
export const getEmailTemplate = (url: string) => renderToString(() => <Email url={url} />)
// sendVerificationEmail.ts
resendClient.emails.send({
from: 'Onboarding <[email protected]>',
to: user.email,
subject: 'Verify your email',
html: getEmailTemplate(url);
});