ec_send_unsent_gift_certificate_recipient_emailWhat it does:
Finds authorized_plus/minus_avs gift certificates for which email has not been sent to the recipient, sends the email, and records that it has been sent.Defined in: /web/philip/tcl/ecommerce-scheduled-procs.tcl
Source code:
ns_log Notice "ec_send_unsent_gift_certificate_recipient_email starting" 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=5))"] while { [ns_db getrow $db $selection] } { set_variables_after_query ec_email_gift_certificate_recipient $gift_certificate_id } ns_db releasehandle $db ns_log Notice "ec_send_unsent_gift_certificate_recipient_email ending"