Answer the question
In order to leave comments, you need to log in
How to implement sending email in nuxtjs?
Good afternoon, dear developers. Can you please tell me how to properly send a message from the form?
I am using nuxtjs , for the sendpulse smtp server
This service has an official plugin .
I tried to use the serverMiddleware from the official example , and in the component where the form is located send to a custom route:
methods: {
onSubmit() {
var email = {
html: "<p>Your email content goes here</p>",
text: this.text,
subject: "Testing SendPulse API",
from: {
name: "Your Sender Name",
email: "[email protected]"
},
to: [
{
name: this.name,
email: this.email
}
]
};
console.log(email);
var answerGetter = function answerGetter(data) {
console.log(data);
};
this.$axios.$post("/api/email", email);
}
},
export default (req, res, next) => {
console.log('works!')
next()
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question