Skip to content

Instantly share code, notes, and snippets.

@ratul16
Last active April 6, 2022 05:50
Show Gist options
  • Select an option

  • Save ratul16/78b8fc7ad79418c2bb06d446b519e9cd to your computer and use it in GitHub Desktop.

Select an option

Save ratul16/78b8fc7ad79418c2bb06d446b519e9cd to your computer and use it in GitHub Desktop.
Email js Function for Vue js
sendEmail() {
emailjs
.send(
"<SERVICE_ID>",
"<TEMPLATE_ID>",
{
subject: this.subject,
user_name: this.name,
user_email: this.email,
message: this.message,
},
"<USER_ID>"
)
.then(
(response) => {
this.showMsg();
console.log("SUCCESS!", response.status, response.text);
},
(err) => {
console.log("FAILED...", err);
}
);
},
showMsg() {
this.showAlert = true;
setTimeout(() => {
this.showAlert = false;
}, 5000);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment