Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-email

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-email

Vue email

  • 0.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
decreased by-3.73%
Maintainers
1
Weekly downloads
 
Created
Source

Vue email

Simple way to build email templates in vue

Documentation | GitHub

What is Vue email?

After see react-email and svelte-email, i took the decision to build the same idea but for vue 😀, there you can design email templates using vue3 and render them to HTML or simple text.

Installation :sunglasses:

It's so simple as install the package in your project:

npm install vue-email
yarn add vue-email
pnpm install vue-email

Getting started 💪

Vue Email provides you a series of components to build a email template

1. Creating a template

This example is based on Nuxt 3 app

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>

2. Send email

This basic example uses Nodemailer and Nuxt 3 to send email. You easily can use other email service provider.

In this example i pass the template by params in a request.

server/api/email.post.ts

import nodemailer from 'nodemailer';

export default defineEventHandler(async (event) => {
  const body = await readBody(event);

  const testAccount = await nodemailer.createTestAccount();

  const transporter = nodemailer.createTransport({
    host: process.env.HOST || 'smtp.ethereal.email',
    port: 587,
    secure: false,
    auth: {
      user: testAccount.user,
      pass: testAccount.pass,
    },
  });

  const options = {
    from: 'you@example.com',
    to: 'user@gmail.com',
    subject: 'hello world',
    html: body.template,
  };

  const info = await transporter.sendMail(options);

  return { messageId: info.messageId, previewUrl: nodemailer.getTestMessageUrl(info) as string };
});

You can see the full example here

Documentation

You can see the documentation here

Components

You can see the components, listed below:

Integrations

Emails built with vue-email can be converted into HTML or plain text, and sent using any email service provider. You can see examples here:

Roadmap

This a list of features to add in the future:

  • Plugin for Nuxt 3
  • TailwindCSS support
  • i18n support

Author

Annotations 📝

This project is originally written in react (react-email) by:

License

This project is licensed under MIT

FAQs

Package last updated on 20 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc