Display Checkbox Value on SendGrid Email page code

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));
}

https://www.wix.com/corvid/forum/community-discussion/page-code-problems-for-sending-selected-checkboxes-values-to-sendgrid-e-mail-alert

Sorry, I’ve looked at the link and realize I must have something wrong with the element names. I tried to look at the final code provided by Raniere Figueiredo but it is no longer available.

2 Questions

  1. Do I need to assign a “let” function to each checkbox to assign a string value if checked?
    example:
    let Phone = ‘’
    if ($w(‘#checkbox1’).checked)
    Phone += “Yes”

  2. If so what does the Body code look like? I have tried this
    \Auth Phone: $(‘#Phone’).value
    and get this
    Auth Phone: $(‘#Phone’).value in the return email.

@rw48mcallister This thread discusses what you’re trying to do and includes working code.

@yisrael-wix Thanks, but this is the same link you provided before that I said I didn’t understand. The answer to my question may be in there but sending it again doesn’t make it clearer.