Last active
April 6, 2022 05:50
-
-
Save ratul16/78b8fc7ad79418c2bb06d446b519e9cd to your computer and use it in GitHub Desktop.
Email js Function for Vue js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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