svelte-email
svelte-email copied to clipboard
Is there any update as to the maintenance of this?
Thanks
Hello!
I'm sure, like me, many of you were looking for a tasty solution for generating emails in your SvelteKit app...
While, sadly, this project seems to be on the back burner, I just wanted to flag that you can use https://github.com/resend/react-email in your SvelteKit project - I ended up opting for it recently and honestly, it was such a pleasure:
Install the packages + React:
npm i react-email @react-email/render @react-email/components react
- types if you need:
npm i -D @types/react
and then in your +page.server.ts or wherever else server-side:
import { render } from '@react-email/render';
// Import your TSX email component
import MyEmailComponent from '$lib/emails/MyEmailComponent';
// Other stuff
const emailHtml = render(
MyEmailComponent({ message: 'Hello from SvelteKit!'})
);
// Send with Sendgrid or whatever you like, at this point output is the same as this package
It does mean that you have to write your email templates in JSX but other than that it's a pretty good compromise to make for a more actively maintained project (with Tailwind support woohoo!).
I think the first prize is to hop on to maintaining this project, but I believe the above is an interim solution.
Hello all, I have decided to fork the project and maintain it as various people have been asking for updates on the project. I have updated the package and ARIA issues thus far and will see what the community wants in regards to future changes. I hope this is not stepping on the author's project as I love it and have enjoyed using it. If the author returns I would not mind archiving the fork either.
For now, if you want to have these two previously mentioned alerts disappear and work on other issues please check-out:
https://github.com/cmjoseph07/svelty-email
Thanks for taking over @cmjoseph07 I'd also like to contribute if you need or if the original author returns. Thanks
@drjamesj
Feel free to jump on any issues you see fit here that you feel comfortable working on and make a pull request on, I plan on starting to tackle some of this stuff this weekend and if there is anything I missed please let me know:
https://github.com/cmjoseph07/svelty-email
List of known issues/request:
1. Error: Component.render(...) is no longer valid in Svelte 5 (#34)
- Reason for Error: 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
2. render and styleToString exports need file types (#28)
- Reason for Error: Playwright test fails to import svelte-email.
- Problem location: svelte-email/src/lib/index.ts
---------------------------------- REQUEST ----------------------------------
1. White Container background (#32)
-
Change Request: Update
Container
default background - Reasoning: To update bg on !important is required, no default to avoid (maybe? | needs testing)
2. Tailwind Support (#16)
- Change Request: Allow ability to pass tw classes to components
- Reasoning: Avoid end-users having to switch from TW to CSS in their project and cause styling confusion
3. Preview component maximum text length - RangeError: Invalid count value (#14)
- Change Request: Error is not descriptive to users that exceed this value.
- Reasoning: svelte-email/src/lib/components/Preview.svelte
Hello!
I'm sure, like me, many of you were looking for a tasty solution for generating emails in your SvelteKit app... While, sadly, this project seems to be on the back burner, I just wanted to flag that you can use https://github.com/resend/react-email in your SvelteKit project - I ended up opting for it recently and honestly, it was such a pleasure: Install the packages + React:
npm i react-email @react-email/render @react-email/components react
- types if you need:
npm i -D @types/react
and then in your +page.server.ts or wherever else server-side:
import { render } from '@react-email/render'; // Import your TSX email component import MyEmailComponent from '$lib/emails/MyEmailComponent'; // Other stuff const emailHtml = render( MyEmailComponent({ message: 'Hello from SvelteKit!'}) ); // Send with Sendgrid or whatever you like, at this point output is the same as this package
It does mean that you have to write your email templates in JSX but other than that it's a pretty good compromise to make for a more actively maintained project (with Tailwind support woohoo!).
I think the first prize is to hop on to maintaining this project, but I believe the above is an interim solution.
Is there a demo repo anywhere showcasing this? Seems like a nice solution. @TomRadford