Hi Sam, thanks for your continued support. First time using the async/await function, so needless to say, the URL is still not inserting for me.
Here’s where I’m at:
import {sendEmail} from 'backend/email';
$w.onReady(function () {
$w("#dataset2").onAfterSave(sendFormData);
});
async function sendFormData() {
const subject = `New Submission from ${$w("#input9").value}`;
let path = await wixLocation.onChange((location) => {
return wixLocation.url;
})
const body = `First Name: ${$w("#input1").value}
\rLast Name: ${$w("#input2").value}
\rEmail: ${$w("#input4").value}
\rPhone: ${$w("#input3").value}
\rPosition/Title: ${$w("#input6").value}
\rCompany: ${$w("#input5").value}
\rHow did you hear about us?: ${$w("#input7").value}
\rIndustry/Application: ${$w("#input8").value}
\rProduct Interest: ${$w("#input9").value}
\rComments: ${$w("#input10").value}
\rURL: path`;
sendEmail(subject, body)
.then(response => console.log(response));
}