Commit 9ceacf3c authored by Frank Bergmann's avatar Frank Bergmann

-- WIP

parent 5a46ecbd
......@@ -162,17 +162,25 @@ ad_proc -private im_project_reminders_send_notification_to_object_members {
# Get final responsible in workflow
if { "" ne $trans_id } { lappend parties_to_be_notified_id $trans_id }
if { "" ne $edit_id } { lappend parties_to_be_notified_id $edit_id }
if { "" ne $proof_id } { lappend parties_to_be_notified_id $proof_id }
if { "" ne $other_id } { lappend parties_to_be_notified_id $other_id }
# Send additional email to Project Manager
lappend parties_to_be_notified_id $trans_project_lead_id
if { "" ne $edit_id } {
set parties_to_be_notified_id [list]
lappend parties_to_be_notified_id $edit_id
}
if { "" eq $parties_to_be_notified_id } {
ns_log Notice "im_project_reminders_send_notification_to_object_members: Exit - No assignments found for translation_task_id: $object_id ($parties_to_be_notified_id)"
return
if { "" ne $proof_id } {
set parties_to_be_notified_id [list]
lappend parties_to_be_notified_id $proof_id
}
if { "" ne $other_id } {
set parties_to_be_notified_id [list]
lappend parties_to_be_notified_id $other_id
}
# Send always email to Project Manager
lappend parties_to_be_notified_id $trans_project_lead_id
}
"im_timesheet_task" {
......@@ -202,6 +210,9 @@ ad_proc -private im_project_reminders_send_notification_to_object_members {
}
}
# remove duplicates
set parties_to_be_notified_id [lsort -unique $parties_to_be_notified_id]
set mail_subject [lang::message::lookup "" intranet-project-reminders.Mail_Subject_Text "Friendly Reminder - Task is due soon "]
set mail_body [lang::message::lookup "" intranet-project-reminders.Mail_Body_Text_Html "Planned end date of task: <br/> $object_name <br/> will be reached shortly and task has not been marked as DONE yet.<br/>Please review."]
......@@ -233,8 +244,9 @@ ad_proc -private im_project_reminders_send_notification_to_object_members {
}
}
foreach email_recipient $parties_to_be_notified_id {
foreach email_recipient_id $parties_to_be_notified_id {
if { !$do_not_send_email_p } {
set email_recipient [db_string sql "select email from parties where party_id = :email_recipient_id" -default 0]
acs_mail_lite::send \
-send_immediately \
-to_addr $email_recipient \
......@@ -243,6 +255,7 @@ ad_proc -private im_project_reminders_send_notification_to_object_members {
-body $mail_body \
-extraheaders "" \
-mime_type "text/html"
ns_log Notice "im_project_reminders_send_notification_to_object_members: Sending email to: $email_recipient"
} else {
ns_log Notice "im_project_reminders_send_notification_to_object_members: do_not_send_email_p = true -> NOT sending email to: $email_recipient"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment