Cannot render email templates without a template engine #4590
-
Good morning, I am currently working on version 6 to build API and I am trying to send an email to register. I performed the node ace make:view emails/verify_email command to generate the resources/views/emails folder. When I run the code in charge of execution import mail from '@adonisjs/mail/services/main'
export default class EmailService {
static async sendActivationEmail(
email: string,
token: string,
name: string | null,
urlBase?: string
) {
const activationUrl = `${urlBase}/activate?token=${token}&email=${encodeURIComponent(email)}`
console.log('class EmailService - sendActivationEmail')
await mail.send((message) => {
message
.from('info@test.com')
.to(email)
.subject('Activate Your Account')
.htmlView('emails/verify_email', { email, activationUrl, name })
})
}
} I get an error
can anyone help me ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
You probably forgot to install and configure edge Docs here: https://docs.adonisjs.com/guides/views-and-templates/edgejs TLDR : just run |
Beta Was this translation helpful? Give feedback.
-
thanks for your answer this command but i had an error
|
Beta Was this translation helpful? Give feedback.
-
I just saw the node ace add edge command in detail and simply added
in the adonisrc.ts file. I no longer have the error. However, I have a problem with my Google ID and password. |
Beta Was this translation helpful? Give feedback.
-
OK Ok, I had to enable two-factor authentication and create a new password I found the solution here, I'll let go if necessary I confirm that I receive the email and this is the first time that I dance with joy upon receiving an email |
Beta Was this translation helpful? Give feedback.
You probably forgot to install and configure edge
Docs here: https://docs.adonisjs.com/guides/views-and-templates/edgejs
TLDR : just run
node ace add edge