Index: openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl 22 Oct 2005 17:05:36 -0000 1.4 +++ openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl 17 Jan 2006 21:58:05 -0000 1.5 @@ -12,6 +12,10 @@ user_id:integer,notnull session_id:integer,notnull return_url:notnull + + type:notnull + community_id:integer,notnull + email_user_id:integer,notnull } -properties { } -validate { } -errors { @@ -26,4 +30,20 @@ where session_id = :session_id } +# Send emails +switch -- type { + "payment" { + dotlrn_community::send_member_email -community_id $community_id -to_user $email_user_id -type "awaiting payment" + } + "prereq" { + set mail_from [parameter::get -package_id [ad_acs_kernel_id] -parameter OutgoingSender] + set community_name [dotlrn_community::get_community_name $community_id] + + if { [parameter::get -package_id [ad_conn package_id] -parameter NotifyApplicantOnRequest] } { + dotlrn_community::send_member_email -community_id $community_id -to_user $email_user_id -type "request approval" + + } + } +} + ad_returnredirect $return_url \ No newline at end of file Index: openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl 20 Dec 2005 03:43:36 -0000 1.28 +++ openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl 17 Jan 2006 21:58:05 -0000 1.29 @@ -70,21 +70,15 @@ ad_script_abort } -switch -- $member_state { - "awaiting payment" { - dotlrn_community::send_member_email -community_id $community_id -to_user $email_user_id -type "awaiting payment" +if { $member_state eq "needs approval" } { + set mail_from [parameter::get -package_id [ad_acs_kernel_id] -parameter OutgoingSender] + set community_name [dotlrn_community::get_community_name $community_id] + + if { [parameter::get -package_id [ad_conn package_id] -parameter NotifyApplicantOnRequest] } { + dotlrn_community::send_member_email -community_id $community_id -to_user $email_user_id -type "needs approval" } - "needs approval" - - "request approval" { - set mail_from [parameter::get -package_id [ad_acs_kernel_id] -parameter OutgoingSender] - set community_name [dotlrn_community::get_community_name $community_id] - - if { [parameter::get -package_id [ad_conn package_id] -parameter NotifyApplicantOnRequest] } { - dotlrn_community::send_member_email -community_id $community_id -to_user $email_user_id -type $member_state - - } - } } + ns_log notice "DEBUG:: RELATION $participant_id, $community_id, $rel_id" set wait_list_notify_email [parameter::get -package_id [ad_acs_kernel_id] -parameter AdminOwner] set mail_from [parameter::get -package_id [ad_acs_kernel_id] -parameter OutgoingSender] @@ -175,7 +169,7 @@ ad_script_abort } - set return_url [export_vars -base "[ad_conn package_url]ecommerce/application-request-2" { user_id session_id {return_url $next_url} }] + set return_url [export_vars -base "[ad_conn package_url]ecommerce/application-request-2" { user_id session_id {return_url $next_url} type community_id email_user_id }] ad_returnredirect [export_vars -base "[apm_package_url_from_id [parameter::get -parameter AssessmentPackage]]assessment" { assessment_id return_url session_id }] }