Index: openacs-4/packages/acs-mail-lite/lib/email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/lib/Attic/email.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-mail-lite/lib/email.tcl 30 Sep 2005 20:36:49 -0000 1.8 +++ openacs-4/packages/acs-mail-lite/lib/email.tcl 30 Sep 2005 21:36:27 -0000 1.9 @@ -11,7 +11,7 @@ } } -foreach optional_param {return_url content export_vars file_ids object_id no_callback} { +foreach optional_param {return_url content export_vars file_ids object_id no_callback_p} { if {![info exists $optional_param]} { set $optional_param {} } @@ -161,58 +161,113 @@ template::multirow foreach messages { if {[exists_and_not_null file_ids]} { + + # If the no_callback_p is set to "t" then no callback will be executed + if { $no_callback_p } { - acs_mail_lite::complex_send \ - -to_addr $to_addr \ - -from_addr "$from_addr" \ - -subject "$subject" \ - -body "$content" \ - -package_id $package_id \ - -file_ids $file_ids \ - -mime_type $mime_type \ - -object_id $object_id \ - -no_callback $no_callback - - } else { - - # acs_mail_lite does not know about sending the - # correct mime types.... - if {$mime_type == "text/html"} { - acs_mail_lite::complex_send \ -to_addr $to_addr \ -from_addr "$from_addr" \ -subject "$subject" \ -body "$content" \ -package_id $package_id \ + -file_ids $file_ids \ -mime_type $mime_type \ -object_id $object_id \ - -no_callback $no_callback - + -no_callback_p + } else { - if { [exists_and_not_null object_id] } { + acs_mail_lite::complex_send \ + -to_addr $to_addr \ + -from_addr "$from_addr" \ + -subject "$subject" \ + -body "$content" \ + -package_id $package_id \ + -file_ids $file_ids \ + -mime_type $mime_type \ + -object_id $object_id + + } + + } else { + + # acs_mail_lite does not know about sending the + # correct mime types.... + if {$mime_type == "text/html"} { + + + if { $no_callback_p } { + # If the no_callback_p is set to "t" then no callback will be executed acs_mail_lite::complex_send \ -to_addr $to_addr \ -from_addr "$from_addr" \ -subject "$subject" \ -body "$content" \ -package_id $package_id \ - -mime_type "text/html" \ + -mime_type $mime_type \ -object_id $object_id \ - -no_callback $no_callback + -no_callback_p } else { - - acs_mail_lite::send \ + + acs_mail_lite::complex_send \ -to_addr $to_addr \ -from_addr "$from_addr" \ -subject "$subject" \ -body "$content" \ -package_id $package_id \ - -no_callback $no_callback + -mime_type $mime_type \ + -object_id $object_id } + + } else { + if { [exists_and_not_null object_id] } { + # If the no_callback_p is set to "t" then no callback will be executed + if { $no_callback_p } { + acs_mail_lite::complex_send \ + -to_addr $to_addr \ + -from_addr "$from_addr" \ + -subject "$subject" \ + -body "$content" \ + -package_id $package_id \ + -mime_type "text/html" \ + -object_id $object_id \ + -no_callback_p + } else { + + acs_mail_lite::complex_send \ + -to_addr $to_addr \ + -from_addr "$from_addr" \ + -subject "$subject" \ + -body "$content" \ + -package_id $package_id \ + -mime_type "text/html" \ + -object_id $object_id + } + } else { + + if { $no_callback_p } { + # If the no_callback_p is set to "t" then no callback will be executed + acs_mail_lite::send \ + -to_addr $to_addr \ + -from_addr "$from_addr" \ + -subject "$subject" \ + -body "$content" \ + -package_id $package_id \ + -no_callback_p + + } else { + acs_mail_lite::send \ + -to_addr $to_addr \ + -from_addr "$from_addr" \ + -subject "$subject" \ + -body "$content" \ + -package_id $package_id + } + + } } } }