How to make bold text using code???

Hello,

How can I make #datePicker3, #datePicker2, #input1, #input2 & #dropdown1 values below bold via code?

import {sendEmail, sendEmailWithRecipient} from ‘backend/email’;

$w.onReady( function () {
$w(“#dataset1”).onAfterSave(sendFormData);
});

function sendFormData() {
const subject = NEW enquiry...;
const body = `

\rABC required from ${$w(“#datePicker3”).value} to ${$w(“#datePicker2”).value} for ${$w(“#input1”).value} adults and ${$w(“#input2”).value} children in ${$w(“#dropdown1”).value}.

sendEmail(subject, body)
.then(response => console.log(response));
}

If you use SendGrid (as you mentioned in your other posts), you should set the style in SendGrid template.

Okay and idea how to connect the Wix code with SendGrid custom template?

@callumsaffet you create templates on Sengrid. You an email.jsw on your back-end, import
sgMail from ‘@sendgrid/mail’ (that you have to set on the node_modules; where you put functions that use SendGrid. You put there the template key as appears on sendgrid. And you call this trigger this function from the front-end when needed.

(Try to look for documentation, it would be clearer than my explanation above)

Thanks @jonatandor35 . However, a little confusing for a newbie. What would you suggest I look for? I’ve already tried searches such as “How to connect Wix code with SendGrid?” and have had no luck finding any documentation.

@callumsaffet basically what you have to do is:

  1. to install @sendgrid/mail on the node_modules (on the back-end

  2. create a .jsw on you back-end with the following code:

import sgMail from '@sendgrid/mail';
export function sendEmail(startTime, endTime, input1, input2, recepient){
    sgMail.setApiKey('XXXXXXXXXXXXXX')//your sendGrid ApiKey
    const msg ={
        to: recepient,
        from: 'callum@mydomain.com',
        templateId: 'x-xxxxxxxxxxxxxxx',//the templateId
        dynamic_template_data: {
            startTime: startTime, 
            endTime: endTime, 
            input1: input1,
            input2: input2
        }
    }
    sgMail.send(msg);
}

import to the front end.
and call the function with the relevant parameters.
Of course all of this will work only after you created the template on SendGrid.