/* This is the contact component. It will allow your user to send you an email. We use Sendgrid by default and you'll need to check /api/sendgrid.js and don't forget to add the environment variables. If you want to change the email provider, don't hesitate to create a new api route and change the axios.post here, line 18. */ import axios from 'axios'; import { toast } from 'react-toastify'; const Contact = (): JSX.Element => { const sendEmail = () => { const name = (document.getElementById('name') as HTMLInputElement).value; const email = (document.getElementById('email') as HTMLInputElement).value; const message = (document.getElementById('message') as HTMLInputElement) .value; if (name && email && message) { axios .post('/api/sendgrid', { email, name, message }) .then((result) => { if (result.data.success === true) { toast.success(result.data.message); (document.getElementById('name') as HTMLInputElement).value = ''; (document.getElementById('email') as HTMLInputElement).value = ''; (document.getElementById('message') as HTMLInputElement).value = ''; } }) .catch((err) => { console.log(err); }); } else { toast.info('Please fill all the fields ', { position: 'top-center', autoClose: 2000, hideProgressBar: true, closeOnClick: true, pauseOnHover: true, draggable: true, progress: undefined, }); } }; return (

Contact

Do you have a question about SupaNexTail? A cool feature you'd like us to integrate? A bug to report? Don't hesitate!

Your Name

Your email

Message