This commit is contained in:
zandercymatics 2024-07-12 12:59:28 -06:00
parent f6e82c7a98
commit bac9dc94aa
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -530,7 +530,7 @@ function initializeWidgetOnList(list, parentId) {
let actionNeededEmail = document.querySelector("#id_action_needed_reason_email");
let actionNeededEmailData = document.getElementById('action-needed-emails-data').textContent;
let noEmailMessage = document.getElementById("no-email-message");
const emptyReasonText = "---------"
const emptyReasonText = "-"
const noEmailText = "No email will be sent."
if(actionNeededReasonDropdown && actionNeededEmail && actionNeededEmailData) {
// Add a change listener to the action needed reason dropdown
@ -558,9 +558,10 @@ function initializeWidgetOnList(list, parentId) {
// Show the "no email will be sent" text only if a reason is actually selected.
noEmailMessage.innerHTML = reason ? noEmailText : emptyReasonText;
console.log(`reaso: ${reason} vs in ${reason in actionNeededEmailsJson}`)
console.log(noEmailMessage)
if (reason && reason in actionNeededEmailsJson) {
let emailData = actionNeededEmailsJson[reason];
let emailBody = emailData.email_body_text
let emailBody = actionNeededEmailsJson[reason];
if (emailBody) {
// Show the email
actionNeededEmail.value = emailBody