// server/api/sendEmail.ts
import { createSSRApp } from 'vue'
import { renderToString } from 'vue/server-renderer'
import template from './template.vue'
export default defineEventHandler(async event => {
const app = createSSRApp({
data: () => ({ count: 1 }),
template: template,
})
const str = await renderToString(app)
// now send the email with the `str` as html body.
return {
htmlString: str,
}
})
// server/api/sendEmail.ts
import { createSSRApp } from 'vue'
import { renderToString } from 'vue/server-renderer'
import template from './template.vue'
export default defineEventHandler(async event => {
const app = createSSRApp({
data: () => ({ count: 1 }),
template: template,
})
const str = await renderToString(app)
// now send the email with the `str` as html body.
return {
htmlString: str,
}
})