Index: openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl 1 Aug 2005 00:06:58 -0000 1.7 +++ openacs-4/packages/dotlrn-ecommerce/tcl/course-procs.tcl 4 Aug 2005 18:49:36 -0000 1.8 @@ -78,6 +78,7 @@ } { return [list "on join" "awaiting payment" "on approval"] } + ad_proc -private dotlrn_ecommerce::email_type_message_key { -type -key @@ -90,16 +91,20 @@ if {[string equal "subject" $key]} { return [string map \ [list \ + "awaiting payment" dotlrn-ecommerce.Application_submitted \ + "on approval" dotlrn-ecommerce.Application_approved \ submit_app dotlrn-ecommerce.Application_submitted \ approve_app dotlrn-ecommerce.Application_approved \ - "on join" "some stuff"] \ + "on join" dotlrn-ecommerce.Welcome_to_section] \ $type] } elseif {[string equal "body" $key]} { return [string map \ [list \ + "awaiting payment" dotlrn-ecommerce.lt_Your_application_has_been_submitted \ + "on approval" dotlrn-ecommerce.lt_Your_application_to_j \ submit_app dotlrn-ecommerce.lt_Your_application_has_been_submitted \ approve_app dotlrn-ecommerce.lt_Your_application_to_j \ - "on join" "some stuff"] \ + "on join" dotlrn-ecommerce.lt_Welcome_to_section_1] \ $type] } else { error "Key must be 'subject' or 'body'" Index: openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 25 Jul 2005 18:16:18 -0000 1.12 +++ openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 4 Aug 2005 18:49:36 -0000 1.13 @@ -298,3 +298,27 @@ } } } + +ad_proc -callback dotlrn::default_member_email -impl dotlrn-ecommerce { +} { + Check course community_id and template community_id in section or + course specific template does not exist +} { + set course_community_id [db_string get_ccid "select dc.community_id + from dotlrn_catalog dc, + dotlrn_ecommerce_section ds + where ds.community_id=:community_id + and ds.course_id=dc.course_id" -default ""] + set template_community_id "" + # set template_community_id [parameter::get -package_id [apm_package_id_from_key dotlrn-ecommerce] -parameter TemplateCommunityId -default ""] + if {[db_0or1row get_email "select * from dotlrn_member_emails where type=:type and community_id=coalesce(:course_community_id,:template_community_id,:community_id)"]} { + return -code return [list $from_addr $subject $email] + } else { + set subject [lang::message::lookup "" [dotlrn_ecommerce::email_type_message_key -type $type -key subject]] + set email [lang::message::lookup "" [dotlrn_ecommerce::email_type_message_key -type $type -key body]] + set from_addr [parameter::get -package_id [ad_acs_kernel_id] -parameter OutgoingSender] + # check to see if message keys exist + return -code return [list $from_addr $subject $email] + } + else return -code continue +}