Using EmailJs is one of the most important decision of project
In this project, we aim to send a message to the user's email using the emailJs tool. At the beginning of the project, we design our form in the Request section.
By using rows and segmenting sections of the page with columns, we create a fully responsive page.
After completing the JSX part of the project, we proceed to send the messages generated through the form. Using the npm website, we download the npm-com package. Then, we complete its code using the documentation provided in the send-form section. The syntax provided by the emailJs documentation is as follows:
emailjs.sendForm(serviceID, templateID, templateParams, options);
It should be noted that in the templateParams
section, we can use a function we created to access the target and place them in this section.
Then, using ReactToastify in the then section, we specify that if the sending status is successful, it should send us a success message. If it fails to properly recognize the email, it should send us an error message.
npm i react-toastify
import {ToastContainer , toast} from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css';
Finally, if we check our email, we will see that it has been successfully sent.
The written codes can be viewed in the source section.