π vue-email
Simple way to build email templates in vue.
!IMPORTANT
Experimental and under heavy development. APIs are subject to change.
Features
- 𧩠Build email templates with Vue components
- π€οΈ SSR support, preview/send emails both on server and client, now with support for deno and bun.
- π i18n support
- π¨ Integrates with many email providers
- π§ͺ Tested against popular email clients
- π¨ Supports Tailwind CSS
- π First-class support for Nuxt 3
- β¨ Written in TypeScript
Setup
# pnpmpnpm add -D vue-email# npmnpm i -D vue-email
Basic Usage
// components/template-email.vue<script setup>import { EButton, EHr, EHtml, EText } from 'vue-email';import { ref } from 'vue'; const user = ref('Dave');</script><template> <e-html lang="en"> <e-text>Hello, {{ user }}!</e-text> <e-hr /> <e-button href="vuejs.org">Visit vue</e-button> </e-html></template>
You can see the full example here
Advanced Usage - SSR
For SSR, you need to install @vue-email/compiler
, now compiler
with support for deno, and bun.
import express from "express";import { config } from "@vue-email/compiler";const app = express();const vueEmail = config("./templates", { verbose: false, options: { baseUrl: "https://vue-email-demo.vercel.app/", },});app.get("/", async function (req, res) { const template = await vueEmail.render("WelcomeEmail.vue", { props: { name: "John Doe", }, }); res.send(template);});app.listen(3000);
π» Development
- Clone this repository
- Enable Corepack using
corepack enable
- Install dependencies using
pnpm install
π Support
If you like our work, please feel to free to support us!
- BTC:
1Bwo1Htd47rLRM4PZhydWtoC5ZAR4Fv9KZ
- USDT: binance-qr
Contributors
Repo Activity
π Annotations
This project is inspired by react-email
License
This project is licensed under MIT
Contributors 4