Index: openacs-4/contrib/packages/mailing-lists/www/list-toggle-subscribe.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/mailing-lists/www/list-toggle-subscribe.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/mailing-lists/www/list-toggle-subscribe.tcl 1 Oct 2003 05:01:54 -0000 1.1 +++ openacs-4/contrib/packages/mailing-lists/www/list-toggle-subscribe.tcl 21 Jan 2004 19:22:15 -0000 1.2 @@ -8,32 +8,36 @@ set user_id [ad_maybe_redirect_for_registration] set package_id [ad_conn package_id] -if {[info exists unsubscribe]} { - # unsubscribe user. i assume that this user currently is subscribed - db_transaction { - template::util::list_to_lookup $list_ids lists - foreach list_id [array names lists] { - db_dml unsubscribe_user {} - } - } -} else { - #subscribe user. check if user already has a map entry - db_transaction { - template::util::list_to_lookup $list_ids lists - foreach list_id [array names lists] { - if {![db_0or1row check_user_entry_exists {}]} { - # add new user map entry - db_dml add_user_entry {} - } else { - # update old user map entry - db_dml subscribe_user {} +db_1row check_email_verified_p {} + +if {$email_verified_p == "t"} { + if {[info exists unsubscribe]} { + # unsubscribe user. i assume that this user currently is subscribed + db_transaction { + template::util::list_to_lookup $list_ids lists + foreach list_id [array names lists] { + db_dml unsubscribe_user {} } - db_1row get_welcome_text {} + } + } else { + #subscribe user. check if user already has a map entry + db_transaction { + template::util::list_to_lookup $list_ids lists + foreach list_id [array names lists] { + if {![db_0or1row check_user_entry_exists {}]} { + # add new user map entry + db_dml add_user_entry {} + } else { + # update old user map entry + db_dml subscribe_user {} + } + db_1row get_welcome_text {} - set unsubscribe_link "[ad_url][ad_conn package_url]?[export_url_vars user_id]" + set unsubscribe_link "[ad_url][ad_conn package_url]?[export_url_vars user_id]" - # send welcome email - mailing_list::util::send_mail -user_id $user_id -from_email $sender_email -subject $welcome_subject -body $welcome_body -mime_type $welcome_mime_type -charset $mime_charset -link $unsubscribe_link + # send welcome email + mailing_list::util::send_mail -user_id $user_id -from_email $sender_email -subject $welcome_subject -body $welcome_body -mime_type $welcome_mime_type -charset $mime_charset -link $unsubscribe_link + } } } }