I'm working on a small email helper that allows you to use the acs
templating system to format the email. Unfortunately it doesn't work
out of the box. One of the mime procedures uses ns_conn
,
which barfs if the thread isn't connected. I made a small change to
this proc, and it works great, but I wonder if there is a more
complete solution to this issue. The proc is in
packages/acs-templating/tcl/mime-procs.tcl:
ad_proc -public template::get_mime_type {} {
set mime_type ""
if {[ns_conn isconnected]} {
set mime_type [ns_set iget [ns_conn outputheaders] "content-type"]
}
if { [empty_string_p $mime_type] } {
set mime_type "text/html"
}
return $mime_type
}
I haven't really investigated why the output headers were consulted
for this, seems like there might be another place to find this
information.