1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { formatDatesInComments } from "https://esm.town/v/willthereader/formatDatesInComments";
import { parentCommentChecker } from "https://esm.town/v/willthereader/parentCommentChecker";
import { replaceHTMLWithTextFormatting } from "https://esm.town/v/willthereader/replaceHtmlWithTextFormatting";
export function formattingEmailContent(commentsArray) {
// console.log(commentsArray);
let commentsString = "";
for (let comment of commentsArray) {
if (comment.parentComment == null)
commentsString += `${comment.authorName}\n${comment.commentText}\n
${comment.createdAt}\n\n\n`;
else {
commentsString += `${comment.parentComment}\n${comment.authorName}
\n${comment.commentText}\n${comment.createdAt}\n\n\n`;
}
}
}