Open mmailaender opened 6 months ago
Hi there, had same issue, don't know if it's the right way to do but here is the workaround to render in Svelte 5.
instead of this code for example :
import { render } from 'svelte-email'
const html = await render({
template: template
})
I use this one :
//import { render } from 'svelte-email'
import { render } from 'svelte/server'
// === Render with props
//const rendered = await render(template, { props: { otp: '333' } })
// === Render
const rendered = await render(template)
const html = rendered?.html
If anyone has a good function to convert nicely to plainText...
EDIT: nevermind, just saw the import { convert } from 'html-to-text'; in the render.ts file :)
Svelte Docs: https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes-server-api-changes
Problem location: https://github.com/carstenlebek/svelte-email/blob/master/src/lib/render.ts#L19