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.23 -r1.24 --- openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 6 Sep 2005 14:59:26 -0000 1.23 +++ openacs-4/packages/dotlrn-ecommerce/tcl/implementation-procs.tcl 6 Sep 2005 17:22:23 -0000 1.24 @@ -104,14 +104,20 @@ set patron_id $saved_patron_id } + if { [exists_and_not_null patron_id] } { + # See if we need to send the welcome email to the # purchaser if { [lsearch [parameter::get -parameter WelcomeEmailRecipients] purchaser] != -1 } { - dotlrn_community::send_member_email -community_id $community_id -to_user $patron_id -type "on join" -override_enabled + ns_log Notice "sending email to patron_id $patron_id for user_id $user_id" + if {$patron_id <> $user_id} { + # if they are the participant, then + # they will get the welcome email for the community + dotlrn_community::send_member_email -community_id $community_id -to_user $user_id -type "on join" -email_send_to $patron_id -override_enabled + } } - # Keep track of patron relationships - if { [exists_and_not_null patron_id] } { + if { [db_0or1row member_rel { select rel_id from dotlrn_member_rels_full