ec_send_unsent_new_order_emailWhat it does:
Finds authorized orders for which confirmation email has not been sent, sends the email, and records that it has been sent.Defined in: /web/philip/tcl/ecommerce-scheduled-procs.tcl
Source code:
set db [ns_db gethandle [philg_server_default_pool]] set selection [ns_db select $db "select order_id from ec_orders o where (order_state='authorized_plus_avs' or order_state='authorized_minus_avs') and (0=(select count(*) from ec_automatic_email_log log where log.order_id=o.order_id and email_template_id=1))"] while { [ns_db getrow $db $selection] } { set_variables_after_query ec_email_new_order $order_id } ns_db releasehandle $db