ec_send_unsent_new_gift_certificate_order_emailWhat it does:
Finds authorized_plus/minus_avs gift certificates 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 gift_certificate_id
from ec_gift_certificates g
where (gift_certificate_state='authorized_plus_avs' or gift_certificate_state='authorized_minus_avs')
and (0=(select count(*) from ec_automatic_email_log log where log.gift_certificate_id=g.gift_certificate_id and email_template_id=4))"]
while { [ns_db getrow $db $selection] } {
set_variables_after_query
ec_email_new_gift_certificate_order $gift_certificate_id
}
ns_db releasehandle $db