Git Product home page Git Product logo

vue-email's Introduction

vue-email

πŸ’Œ vue-email

npm version npm downloads license docs

Simple way to build email templates in vue.

Important

Experimental and under heavy development. APIs are subject to change.

Features

Setup

πŸ“– Read the documentation

# pnpm
pnpm add -D vue-email

# npm
npm i -D vue-email

Basic Usage

πŸ“– Read the documentation

// components/template-email.vue
<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>

<script setup>
import { EButton, EHr, EHtml, EText } from 'vue-email';
import { ref } from 'vue';
   
const user = ref('Dave');
</script>

You can see the full example here

Advanced Usage - SSR

πŸ“– Read the SSR documentation

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

  1. Clone this repository
  2. Enable Corepack using corepack enable
  3. 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

vue-email's People

Contributors

flowko avatar dave136 avatar danielroe avatar benjamincanac avatar cpreston321 avatar jeam avatar v-moravec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.