Skip to content
Discussion options

You must be logged in to vote

It works with node without a bundler.

render.mjs

import { config } from "@vue-email/compiler";
import nodemailer from "nodemailer";
import { emailTailwindConfig } from "./config/email-tailwind.config.mjs";

const templateName = "WeeklyEmail.vue";

const vueEmail = config("./templates", {
  verbose: true, // Shows more detailed logs
  options: {}
});

const transporter = nodemailer.createTransport({
  host: "localhost", // Use Mailpit
  port: 1025,
  secure: false,
  ignoreTLS: true
});

async function renderAndSendEmail() {
  const template = await vueEmail.render(templateName, {
    props: {
      name: "John Doe",
      emailTailwindConfig
    }
  });

  console.log(template.html);

  /…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gogokimc
Comment options

Answer selected by iPy849
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants