So I have this form, and I followed this tutorial about sending an email from form submission and all worked ok. But I want to make that the email being sent will have the user’s email from the “Your email” input box in order to reply strait to it when the email arrives. I tried putting in const sender = $w(“#email”).value in the eamil.jsw backend but it will not return that value! (the Your email line is connected to #email and works ok with the cms collection)
Continue to read the article, the part of Modifying the Code , you will get en explanation on how to get the email user to the backend function as parameter.
*The backend email.jsw supposed to include the second function in the picture below when you get the recipient as parameter.
Pay attention, that the backend function can’t reach to the element in the site page.
No, what you wrote is wrong. I finally solved it, I added const sender = $w(“#email”).value to the frontend and added “sender” to the sendEmail. With that, in the email.jsw I removed the const sender and added sender to the export function sendEmail()
Now everything works!