I am working on a Google Apps Script project where I am using the Gmail API to send a reply to a specific message within a Gmail thread. The reply email body needs to be retrieved from a cell in another sheet in Google Sheets. The cell contains a multi-paragraph text that I want to preserve the paragraph structure and font size in the reply message.
Here is an example of the desired email body:
"I know you are extremely busy, and there is a possibility my last email got buried.
I would be happy to provide you with more details. Your opinion will be very helpful in deciding whether or not I have a chance to participate in your company.
Regards, "
Currently, I am using the following code to construct the reply message:
var htmlBody = "<u><b>sample HTML body</b></u>"; // This is a sample HTML body.
var data = [
"MIME-Version: 1.0\n",
`In-Reply-To: ${messageId}\n`,
`Subject: Re:${originalMessage.getSubject()}\n`,
`From: ${senderName} <${senderEmail}>\n`,
`To: ${recipientEmail}\n`,
"Content-type: text/html; charset=UTF-8\n",
"Content-Transfer-Encoding: quoted-printable\n\n",
htmlBody,
].join("");
However, I am unsure how to modify this code to properly preserve the paragraph structure and font size of the email body text retrieved from the cell.
I would greatly appreciate any insights, suggestions, or alternative approaches to ensure that the paragraph structure and formatting are maintained when using the Gmail API to send the reply email. Thank you in advance for your assistance!