Index: openacs-4/packages/dotlrn/tcl/spam-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/spam-procs.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/dotlrn/tcl/spam-procs.tcl 9 Aug 2002 18:39:25 -0000 1.3 +++ openacs-4/packages/dotlrn/tcl/spam-procs.tcl 6 Mar 2003 17:54:01 -0000 1.3.2.1 @@ -72,38 +72,13 @@ # loop through all the recepients and send them the spam set errors "" - db_foreach select_recepient_info " - select parties.email, - decode(acs_objects.object_type, - 'user', - (select first_names - from persons - where person_id = parties.party_id), - 'group', - (select group_name - from groups - where group_id = parties.party_id), - 'rel_segment', - (select segment_name - from rel_segments - where segment_id = parties.party_id), - '') as first_names, - decode(acs_objects.object_type, - 'user', - (select last_name - from persons - where person_id = parties.party_id), - '') as last_name - from parties, - acs_objects - where party_id in ([join $recepients ,]) - and parties.party_id = acs_objects.object_id - " { + db_foreach select_recepient_info {} { # replace some values in the subject and the message set values [list] - lappend values [list {} $email] - lappend values [list {} $first_names] - lappend values [list {} $last_name] + lappend values [list \{email\} $email] + lappend values [list \{first_names\} $first_names] + lappend values [list \{last_name\} $last_name] + lappend values [list \{from\} $from] set subject [interpolate -values $values -text $subject] set message [interpolate -values $values -text $message] Index: openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl 9 Aug 2002 18:39:27 -0000 1.8 +++ openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl 6 Mar 2003 17:54:01 -0000 1.8.2.1 @@ -76,6 +76,29 @@ dotlrn_community::add_user $community_id $user } } + + # Now notify the users that they've been added to the community. + + set sender_email [cc_email_from_party [ad_conn user_id]] + foreach {community} $communities { + if { $community_id == [lindex $community 1] } { + set community_name [lindex $community 0] + break + } + } + + set subject "You have been added to the \"$community_name\" community at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]" + set message "To visit the community's home page, point your browser at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL], +log in, and click on the \"$community_name\" link in the \"Groups\" portlet. +" + + spam::send \ + -recepients $users \ + -from $sender_email \ + -real_from $sender_email \ + -subject $subject \ + -message $message \ + -message_values [list] } ad_returnredirect $referer Index: openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 2 Mar 2003 22:40:19 -0000 1.7.2.1 +++ openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 6 Mar 2003 17:54:01 -0000 1.7.2.2 @@ -37,7 +37,7 @@ doc_body_append "Bulk Uploading....

" -set list_of_user_ids [list] +set list_of_user [list] set list_of_addresses_and_passwords [list] # Do the stuff @@ -48,9 +48,10 @@ # First make sure the required data is there - if { ![info exists $row(email)] || ![info exists $row(first_names)] || ![info exists $row(last_name)] } { + if { ![info exists row(email)] || ![info exists row(first_names)] || ![info exists row(last_name)] } { doc_body_append "
Datafile must include at least the email, first_names and last_name fields
" db_abort_transaction + return } # We need to insert the ACS user @@ -60,11 +61,12 @@ set user_id [cc_lookup_email_user $row(email)] if {![empty_string_p $user_id]} { doc_body_append "User $row(email) already exists... storing user_id" - lappend list_of_user_ids $user_id + lappend list_of_users $user_id } else { set user_id [ad_user_new $row(email) $row(first_names) $row(last_name) $password "" "" "" "t" "approved"] - lappend list_of_user_ids $user_id + lappend list_of_users $user_id + lappend list_of_addresses_and_passwords $row(email) $password if {![info exists row(type)]} { set row(type) student @@ -82,7 +84,7 @@ set row(id) $row(email) } - doc_body_append "Creating ser $row(email)...." + doc_body_append "Creating user $row(email)...." # Now we make them a dotLRN user switch -exact $row(access_level) { @@ -121,28 +123,29 @@ doc_body_append "

Sending email notifications to users...

" foreach {email password} $list_of_addresses_and_passwords { - set message " -You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl]. + if { ![string equal $password ""] } { + set message " +You have been added as a user to [ad_system_name] at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]. Login: $row(email) Password: $password " - # Send note to new user - if [catch {ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_parameter SystemUrl]" "$message"} errmsg] { - doc_body_append "emailing \"$email\" failed!
" - set fail_p 1 - } else { - doc_body_append "email sent to \"$email\"
" + # Send note to new user + if [catch {ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]" "$message"} errmsg] { + doc_body_append "emailing \"$email\" failed!
" + set fail_p 1 + } else { + doc_body_append "email sent to \"$email\"
" + } } - } if {$fail_p} { doc_body_append "

Some of the emails failed. Those users had random passwords generated for them, however. The best way to proceed is to have these users log in and ask them to click on 'I have forgotten my password'.

" } -doc_body_append "

- - -You may now choose to

" +doc_body_append "

+ + +You may now choose to

" doc_body_append "or, return to User Management." Index: openacs-4/packages/dotlrn/www/admin/users-spam.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-spam.adp,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/dotlrn/www/admin/users-spam.adp 9 Aug 2002 18:39:27 -0000 1.5 +++ openacs-4/packages/dotlrn/www/admin/users-spam.adp 6 Mar 2003 17:54:01 -0000 1.5.2.1 @@ -24,4 +24,38 @@ - +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
The following variables can be used to insert user/community specific data:
{from} = Sender's Email Address
{email} = Recipient's Email
{first_names} = Recipient's First Name
{last_name} = Recipient's Last Name
+ +