HI
can some one help me with my code and tell me what i have done wrong here i want to send the user to the home page after the code has run
many thanks
F
import {sendEmail} from 'backend/email';
import wixLocation from 'wix-location';
$w.onReady(function () {
});
export function submitCheckinButton_click(event, $w) {
// sendEmail is called with: email provider name (like:gmail), template id (like "thanks_for_interest") and params.
// params holds ALL variables for your email: sender name/email, recipients, cc´s, bcc´s, subject, body and more specific
// values to fill the template, like, in our example, Arrival, Departure and Remarks.
let myprovider = "gmail"; //use her the alias you used for this service in emailJS
let mytemplate = "check_ins"; //use her the template name you defined in emailJS
let myparams = {
"from_email": $w("#emailAddress").text,
"to_email": "Krays23@hotmail.com",
"replyto_email": $w("#emailAddress").text,
"weight": $w("#currentWeight").value,
"fat": $w("#fatInpercentage").value,
"comments": $w("#howTheyfelt").value,
"name": $w("#fullName").text,
"date": $w("#checkInDate").value,
"front_photo": $w("#frontPhotoupload").value,
//"cc_email": "foo3@bar.com",
//"Arrival": "25-03-2018",
//"Departure": "28-03-2018",
//"Remarks": "Could we have coffee instead of tea for breakfast?",
//"from_Name": "Giri´s Code Corner"
};
sendEmail (myprovider, mytemplate, myparams);
$w('#checkInUploadBox').show();
$w('#checkInsWrite').setFieldValue('name', $w('#fullName').text);
$w('#checkInsWrite').setFieldValue('emailAddress', $w('#emailAddress').text);
$w("#checkInsWrite").save();
$w('#checkInsWrite').onAfterSave(()=>{
wixLocation.to("/home")
})
}