Index: openacs-4/packages/contacts/lib/email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/email.tcl,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/contacts/lib/email.tcl 5 Mar 2006 08:34:12 -0000 1.21 +++ openacs-4/packages/contacts/lib/email.tcl 12 Mar 2006 14:38:47 -0000 1.22 @@ -45,7 +45,7 @@ no_callback_p:text(hidden) title:text(hidden),optional {message_type:text(hidden) {value "email"}} - {to:text(checkbox),multiple + {to:text(checkbox),multiple,optional {label "[_ contacts.Recipients]"} {options $recipients } {html {checked 1}} @@ -70,7 +70,7 @@ {section "[_ contacts.Recipients]"} {html {onclick check_uncheck_boxes(this.checked)}} } - {to:text(checkbox),multiple + {to:text(checkbox),multiple,optional {label "[_ contacts.Recipients]"} {options $recipients } {html {checked 1}} @@ -108,22 +108,15 @@ lappend form_elements $element } -if { ![exists_and_not_null mime_type] } { - set mime_type "text/plain" -} - -set content_list [list $content $mime_type] - append form_elements { {subject:text(text),optional {label "[_ contacts.Subject]"} {html {size 55}} {section "[_ contacts.Message]"} } - {content_body:text(richtext),optional + {content_body:richtext(richtext),optional {label "[_ contacts.Message]"} {html {cols 55 rows 18}} - {value $content_list} {help_text "[_ contacts.lt_remember_that_you_can]"} } {upload_file:file(file),optional @@ -170,6 +163,11 @@ } } } -edit_request { + if {![exists_and_not_null mime_type]} { + set mime_type "text/plain" + } + + set content_list [list $content $mime_type] } -on_submit { # We get the attribute_id of the salutation attribute @@ -186,6 +184,8 @@ set cc_list [split $cc ";"] + set mime_type [template::util::richtext::get_property format $content_body] + set content_body [template::util::richtext::get_property contents $content_body] template::multirow create messages message_type to_addr to_party_id subject content_body # Insert the uploaded file linked under the package_id @@ -200,6 +200,8 @@ lappend file_ids $revision_id } + set locale [lang::system::site_wide_locale] + # Send the mail to all parties. foreach party_id $to { @@ -293,12 +295,10 @@ -file_ids $file_ids \ -mime_type $mime_type \ -object_id $object_id \ - -no_callback_p + -no_callback } else { -# ad_return_error "$file_ids" "$content_body :: $mime_type" - acs_mail_lite::complex_send \ -to_addr $to_addr \ -from_addr "$from_addr" \ @@ -329,7 +329,7 @@ -package_id $package_id \ -mime_type $mime_type \ -object_id $object_id \ - -no_callback_p + -no_callback } else { @@ -357,7 +357,7 @@ -package_id $package_id \ -mime_type "text/html" \ -object_id $object_id \ - -no_callback_p + -no_callback } else { acs_mail_lite::complex_send \ @@ -380,7 +380,7 @@ -subject "$subject" \ -body "$content_body" \ -package_id $package_id \ - -no_callback_p + -no_callback } else { acs_mail_lite::complex_send \ Index: openacs-4/packages/contacts/lib/oo_mailing.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/oo_mailing.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/contacts/lib/oo_mailing.tcl 5 Mar 2006 08:34:12 -0000 1.10 +++ openacs-4/packages/contacts/lib/oo_mailing.tcl 12 Mar 2006 14:38:47 -0000 1.11 @@ -240,7 +240,7 @@ } else { # We are not sending the e-mail but write the file back to the user - if {[llength $file_revisions]==1} { + if {[llength $file_revisions]>=1} { cr_write_content -revision_id [lindex $file_revisions 0] } }