2
0
forked from Wavyzz/dolibarr

WIP mail layout

This commit is contained in:
ldestailleur
2025-04-17 00:56:22 +02:00
parent 2a7b9a2466
commit 9f3281cf1d
6 changed files with 53 additions and 25 deletions

View File

@@ -1560,25 +1560,20 @@ class FormMail extends Form
$out .= '</div>';
$out .= '<script type="text/javascript">
$(document).ready(function() {
$(".template-option").click(function() {
var template = $(this).data("template");
var subject = jQuery("#subject").val();
var fromtype = jQuery("#fromtype").val();
var sendto = jQuery("#sendto").val();
var sendtocc = jQuery("#sendtocc").val();
var sendtoccc = jQuery("#sendtoccc").val();
$(document).ready(function() {
$(".template-option").click(function() {
var template = $(this).data("template");
var subject = jQuery("#subject").val();
var fromtype = jQuery("#fromtype").val();
var sendto = jQuery("#sendto").val();
var sendtocc = jQuery("#sendtocc").val();
var sendtoccc = jQuery("#sendtoccc").val();
console.log("We choose a layout for email template=" + template + ", subject="+subject);
$(".template-option").removeClass("selected");
$(this).addClass("selected");
var subject = $("#sujet").val();
var contentHtml = $(this).data("content");
contentHtml = contentHtml.replace(/__SUBJECT__/g, subject);
if (template === "news") {
$("#post-dropdown-container").show();
console.log("Displaying dropdown for news template");
@@ -1631,7 +1626,7 @@ class FormMail extends Form
},
success: function(response) {
var selectedPosts = JSON.parse(response);
var subject = $("#sujet").val();
var subject = $("#subject").val();
contentHtml = contentHtml.replace(/__SUBJECT__/g, subject);