Hi there! I have successfully created a custom form. When a user submits their content, it is emailed to me using sendgrid and the recommended email.jsw and sendGrid.js modules. This all works great!
The issue I’m having is in formatting the text within the email, such as having the question labels in bold text, with the answers not bold. Forgive me if this is a SUPER obvious answer, but I’m very new to Java. How do I format my text within the email?
Here’s an example of the code I’m talking about. If I wanted just the first input value (the person’s name) and the line, “What is the issue you’re having?” in bold, how would I do that?
import {sendEmail} from ‘backend/email’;
$w.onReady(function () {
$w(“#contactformDataset”).onAfterSave(sendFormData);
});
function sendFormData() {
const subject = New Campaign Reach from ${$w("#nameInput").value}
;
const body = Name: ${$w("#nameInput").value} \rEmail: ${$w("#emailInput").value} \rPhone: ${$w("#phoneInput").value} \rCompany: ${$w("#companyInput").value} \rWhat is the issue you're having? \r${$w("#messageBox").value} \rNeeds: ${$w("#lookingFor").value}
;
sendEmail(subject, body)
.then(response => console.log(response));
}