Added Emaillog to PreorderBillingInvoice

This commit is contained in:
Frank Schubert
2025-09-17 12:45:42 +02:00
parent 3506bc51fb
commit 5190ce031b
4 changed files with 223 additions and 4 deletions

View File

@@ -172,7 +172,9 @@ $pagination_entity_name = "Emails";
$("#email-log-to-value").text("");
$("#email-log-log-sent-value").text("");
$("#email-log-subject-value").text("");
$("#email-log-view").empty();
document.getElementById("email-log-body-view").contentWindow.document.open();
document.getElementById("email-log-body-view").contentWindow.document.write("<html><body>&nbsp;</body></html>");
document.getElementById("email-log-body-view").contentWindow.document.close();
$("#email-log-attachments-section").hide();
$("#email-log-attachment-list").empty();
hideHeaders();
@@ -218,11 +220,16 @@ $pagination_entity_name = "Emails";
$("#email-log-attachments-section").show();
}
document.getElementById("email-log-body-view").contentWindow.document.open();
if(email.bodyIsHtml) {
$("#email-log-body-view").html(email.body);
document.getElementById("email-log-body-view").contentWindow.document.write(email.body);
} else {
$("#email-logbody-view").text(email.body);
var html_body = '<html lang="de"><head><meta charset="utf-8" /></head><body><p>';
html_body += email.body.replaceAll("\r", "").replaceAll("\n", "<br />");
html_body += '</p></body></html>';
document.getElementById("email-log-body-view").contentWindow.document.write(html_body);
}
document.getElementById("email-log-body-view").contentWindow.document.close();
$("#email-log-modal").modal("show");