Index: openacs-4/packages/contacts/tcl/contact-message-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-message-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/contacts/tcl/contact-message-procs.tcl 20 Feb 2006 10:55:48 -0000 1.23 +++ openacs-4/packages/contacts/tcl/contact-message-procs.tcl 20 Feb 2006 21:24:21 -0000 1.24 @@ -181,8 +181,8 @@ # if this person is the employee of # an organization we can attempt to use # that organizations email address - foreach employer_id [contact::util::get_employers -employee_id $party_id] { - set email [contact::email -party_id $employer_id] + foreach employer [contact::util::get_employers -employee_id $party_id] { + set email [contact::email -party_id [lindex $employer 0]] if { $email ne "" } { break } @@ -208,14 +208,18 @@ ad_proc -private contact::message::mailing_address { {-party_id:required} {-format "text/plain"} + {-package_id ""} } { Returns a parties mailing address. Cached } { regsub -all "text/" $format "" format if { $format != "html" } { set format "text" } - return [util_memoize [list ::contact::message::mailing_address_not_cached -party_id $party_id -format $format -package_id [ad_conn package_id]]] + if { $package_id eq "" } { + set package_id [ad_conn package_id] + } + return [util_memoize [list ::contact::message::mailing_address_not_cached -party_id $party_id -format $format -package_id $package_id]] } ad_proc -private contact::message::mailing_address_not_cached { @@ -241,8 +245,8 @@ # if this person is the employee of # an organization we can attempt to use # that organizations email address - foreach employer_id [contact::util::get_employers -employee_id $party_id] { - set mailing_address [contact::message::mailing_address -party_id $employer_id -package_id $package_id] + foreach employer [contact::util::get_employers -employee_id $party_id] { + set mailing_address [contact::message::mailing_address -party_id [lindex $employer 0] -package_id $package_id] if { $mailing_address ne "" } { break }