Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl,v diff -u -r1.18.2.1 -r1.18.2.2 --- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl 6 Feb 2020 13:00:21 -0000 1.18.2.1 +++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl 10 Feb 2021 11:50:16 -0000 1.18.2.2 @@ -139,32 +139,55 @@ set package_id [ad_conn package_id] } - # set a reasonable default for send_date - if {$send_date eq ""} { - set send_date [db_string select_current_date {}] - } - # set a reasonable default for the reply_to header if {$reply_to eq ""} { set reply_to $from_addr } # prepare the data - set extra_vars [ns_set create] - ns_set put $extra_vars package_id $package_id - ns_set put $extra_vars send_date $send_date - ns_set put $extra_vars date_format $date_format - ns_set put $extra_vars from_addr $from_addr - ns_set put $extra_vars subject $subject - ns_set put $extra_vars reply_to $reply_to - ns_set put $extra_vars extra_headers "$extra_headers bulk-mail-type $message_type" - ns_set put $extra_vars message $message - ns_set put $extra_vars message_type $message_type - ns_set put $extra_vars query $query - ns_set put $extra_vars context_id $package_id + if {[ns_conn isconnected]} { + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + } else { + set creation_user "" + set creation_ip "" + } - # create the new bulk_mail message - return [package_instantiate_object -extra_vars $extra_vars "bulk_mail_message"] + set object_id [db_exec_plsql create_object {}] + + set extra_headers "$extra_headers bulk-mail-type $message_type" + + db_dml insert_metadata { + insert into bulk_mail_messages + ( + bulk_mail_id, + package_id, + send_date, + status, + from_addr, + subject, + reply_to, + extra_headers, + message, + query + ) + values + ( + :object_id, + :package_id, + to_timestamp(cast(coalesce(:send_date, current_timestamp) as text), + coalesce(:date_format, 'YYYY MM DD HH24 MI SS')), + 'pending', + :from_addr, + :subject, + :reply_to, + :extra_headers, + :message, + :query + ) + } + + return $object_id } ad_proc -private sweep { Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql 21 Nov 2017 13:14:58 -0000 1.3 +++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.xql 10 Feb 2021 11:50:16 -0000 1.3.2.1 @@ -17,12 +17,6 @@ - - - select to_char(current_timestamp, :date_format) from dual - - - select bulk_mail_messages.*