I have a form and I’ve set up a code to send that form to my email on submit. However, the checkboxes get bundled into one line and I want to have a line break before/after each one so the email is more easily readable. How do I go about doing that? I tried both /n and
with no luck, though I might just not know where is the right place for them. Here is my code:
import {sendEmail} from ‘backend/email’;
$w.onReady( function () {
$w(“#WannaHelpForm”).onAfterSave(sendFormData);
});
function sendFormData() {
const subject = New email from ${$w("#name").value}
;
let body = name: ${$w("#name").value} \remail: ${$w("#email").value} \rphone: ${$w("#phone").value}
;
if ($w(“#CheckboxUpdates”).checked){
body+= Check Box Label 1
;
}
if ($w(“#CheckboxVolunteer”).checked){
body+= Check Box Label 2
;
}
if ($w(“#CheckboxSign”).checked){
body+= Check Box Label 3
;
}
if ($w(“#CheckboxHost”).checked){
body+= Check Box Label 4
;
}
if ($w(“#CheckboxCome”).checked){
body+= Check Box Label 5
;
}
sendEmail(subject, body)
.then(response => console.log(response));
}