[Question] How to use Vuemail with AdonisJS #194
-
As the title suggests How can i use Vuemail with AdonisJS (which is a backend framework)? Here is a sample code of how i am trying to use Vuemail: import { BaseMail } from '@adonisjs/mail'
import Template from '../../resources/views/emails/joined_waitinglist.vue'
import { render } from '@vue-email/render'
export default class JoinedWaitlistNotification extends BaseMail {
subject = 'You are in the patiently waiting list'
constructor(private email: string) {
super()
}
/**
* The "prepare" method is called automatically when
* the email is sent or queued.
*/
async prepare() {
const html = await render(
Template,
{
title: 'some title',
},
{
pretty: true,
}
)
this.message.subject(this.subject).to(this.email).html(html)
}
} When run this code throws the following error: In the docs I can see an example of how to use Vuemail server side with Nuxt. but there is no example with normal server side frameworks. It would be good to have that. Finally, in the docs it says:
Not sure how to do it using a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
hi, the main focus of this library is to work with vue and nuxt/nitro, we are not planning to support anything that doesnt support vue, so if AdonisJs allows you to somehow configure it to load .vue files, then that should work, by the issue you got, you just need to find a way to load the but other than that, i cant really help you any further, hope you find a way to resolve your issue, if you do please share it here |
Beta Was this translation helpful? Give feedback.
-
It took a lot of back and forth and number of people from Adonisjs community but but now finally we have a working example of Vuemail with Adonjs 6 |
Beta Was this translation helpful? Give feedback.
-
I got it to work in Node.js runtime earlier with the usage of |
Beta Was this translation helpful? Give feedback.
It took a lot of back and forth and number of people from Adonisjs community but but now finally we have a working example of Vuemail with Adonjs 6
https://github.com/khawarizmus/vuemail-adonis