Svelty-Email is a community-maintained fork of the svelte-email library, designed to facilitate the creation and rendering of email templates using Svelte. Inspired by React-Email, it allows developers to build responsive, component-based email layouts in a familiar Svelte environment, abstracting away the complexities of traditional HTML email development, such as table-based structures. The current stable version is 0.1.1, with a primary focus on adapting to Svelte's evolving ecosystem, including ongoing work for Svelte 5 support. Its key differentiator is enabling a modern Svelte development workflow for email templating, integrating seamlessly with SvelteKit projects and rendering emails to robust HTML or plain text suitable for various email service providers like Nodemailer. This project aims to keep the original library's vision alive and updated.
npm install svelty-emailVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a basic email template using Svelte components provided by svelty-email and then render it to HTML for sending via Nodemailer in a SvelteKit context.
For Svelte 4 projects: `npm install svelty-email@0.0.11`. For Svelte 5 projects: ensure your SvelteKit setup is compatible with Svelte 5 and install `svelty-email@latest`.
Always use `svelty-email` in your project's `package.json` and `import` statements. Adapt examples from the old documentation by replacing the package name.
Always wrap your email content, including `Section` components, within the `Html` component, which should typically be the root element of your email template.
Use advanced examples as a conceptual guide but be prepared to update asset paths, styling, and potentially component usage to align with the latest `svelty-email` version and your project's structure.
For Svelte 4 projects, downgrade `svelty-email` to version `0.0.11` (`npm install svelty-email@0.0.11`). For Svelte 5 projects, ensure your SvelteKit setup is fully updated to Svelte 5 and use the latest `svelty-email`.
Ensure the package is installed by running `npm install svelty-email` or `pnpm install svelty-email` in your project's root directory.
Install `nodemailer` separately using your package manager: `npm install nodemailer` or `pnpm install nodemailer`.