I want to send email with HTML body, but I don't have access to server code, I can only send the email content via ajax. The server already has API to send email.
I have the component invoiceEmail rendered on the fly.
sendEmail () {
const mailConfig = {
to : '[email protected]',
subject : 'Your Invoice',
// body : this.$refs.invoiceEmail.$el, // this doesn't work
// I'm getting error "converting circular structure to json"
body : '<strong style="color:red;">red bold</strong>', // this works
}
this.$api.POST('send-email', mailConfig)
.then(response => {})
.catch(error => {})
.finally(() => {})
},
}
If I fill body with HTML as string: '<strong>this should be bold</strong>', it works as expected. So if I can just get the HTML, I'm sure the code will work.
This is console.log(this.$refs.invoiceEmail.$el)
What should I use to get the plain HTML instead of this.$refs.invoiceEmail.$el ??
