xxxxxxxxxx
<script>
import emailjs from 'emailjs-com';
import {ref} from 'vue';
export default {
setup() {
const form = ref(null);
const inputFieldReset = ref(null);
const sendMail = () => {
emailjs.sendForm('SERVICE_ID', 'TEMPLATE_ID', form.value, 'USER_ID')
.then(() => {
alert('Message sent!')
inputFieldReset.value = " ";
}, (error) => {
alert('Message not sent', error);
});
}
}
return{
form,
inputFieldReset,
sendMail
}
}
}
</script>