I have created a form to provide contact information for our community. I have 2 check boxes which enable the user to allow (checked) or disallow (unchecked) publication of phone and/or email content in an on-line directory. I have set up the submit button to generate several e-mails using Sendgrid, which display the information submitted. My problem is the display of the boolean status of the 2 checkboxes.
When the form is submitted all of the information is displayed for each of the text fields except the boolean checkboxes which remain blank regardless of entry.
First Name: John
Last Name: Doe
Street: 123 Elm St
City: Somewhere
State: NC
Zip: 33333
Phone #1: 123-561-4569
Phone #2:
Phone #3:
E-Mail #1: johndoe@gmail.com
E-Mail #2:
Auth Phone:
Auth E-Mail:
How can I display a check mark or true/false for the checkbox value on the emails.
Here is the page code I use to generate the e-mails
import {sendEmail, sendEmailWithRecipient, sendThirdEmail,sendForthEmail} from ‘backend/email’;
$w.onReady( function () {
$w(“#dataset1”).onAfterSave(sendFormData);
});
function sendFormData() {
const subject = Updated XXXXXX Resident Information **for** ${$w("#input1").value} ${$w("#input2").value}
;
const body = ${$w("#input1").value} here is the information you submitted **for** XXXXX records and our on-line directory. \First Name: ${$w("#input1").value} \Last Name: ${$w("#input2").value} \Street: ${$w("#input3").value} \City: ${$w("#input4").value} \State: ${$w("#input11").value} \Zip: ${$w("#input5").value} \Phone #1: ${$w("#input6").value} \Phone #2: ${$w("#input7").value} \Phone #3: ${$w("#input8").value} \E-Mail #1: ${$w("#input9").value} \E-Mail #2: ${$w("#input10").value} \Auth Phone: $($w("#Checkbox1").value) \Auth E-Mail:$($w("#Checkbox2").value)
;
const recipient = $w(“#input9”).value;
sendEmailWithRecipient(subject, body, recipient)
.then(response => console.log(response));
sendEmail(subject, body)
.then(response => console.log(response));
sendThirdEmail(subject, body)
.then(response => console.log(response));
sendForthEmail(subject, body)
.then(response => console.log(response));
}