Quickstart
1
Install Vue.Email components
2
Create templates folder
Create a new folder called
emails in your src folder.3
Update nuxt.config.ts File
4
Write your email
5
Write your workflow
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Design responsive email templates for Novu workflows with Vue Email components and render them from your Framework email step at trigger time.
Install Vue.Email components
npm install @vue-email/components
Create templates folder
emails in your src folder.Update nuxt.config.ts File
export default defineNuxtConfig({
build: {
transpile: ['@vue/email'],
},
nitro: {
esbuild: {
options: {
target: 'esnext',
},
},
},
});
Write your email
<script setup lang="ts">
defineProps<{
name: string;
}>();
</script>
<template>
<VueEmail>
<Html>
<Head />
<Preview>Welcome to Vue Email</Preview>
<Container>
<h1>Welcome, {{ name }}!</h1>
<p>Thanks for trying Vue Email. We're thrilled to have you on board.</p>
</Container>
</Html>
</VueEmail>
</template>
Write your workflow
export const testWorkflow = workflow('test-workflow', async ({ step, payload }) => {
await step.email('send-email', async (controls) => {
return {
subject: controls.subject,
body: renderEmail(payload.userName),
};
},
{
controlSchema: z.object({
subject: z.string().default('A Successful Test on Novu from {{userName}}'),
}),
});
}, {
payloadSchema: z.object({
userName: z.string().default('John Doe'),
}),
});
Was this page helpful?