acs_messaging_process_queue (private)

 acs_messaging_process_queue

Defined in packages/acs-messaging/tcl/acs-messaging-procs.tcl

Process the message queue, sending any reasonable messages.

Partial Call Graph (max 5 caller/called nodes):
%3 acs_mail_lite::send acs_mail_lite::send (public) db_dml db_dml (public) db_foreach db_foreach (public) acs_messaging_process_queue acs_messaging_process_queue acs_messaging_process_queue->acs_mail_lite::send acs_messaging_process_queue->db_dml acs_messaging_process_queue->db_foreach

Testcases:
No testcase defined.
Source code:
    db_foreach acs_message_send {} {
        if {![catch {
            acs_mail_lite::send -send_immediately  -to_addr $recip_email  -from_addr $sender_email  -subject $title  -body $content
        } errMsg]} {
            # everything went well, dequeue
            db_dml acs_message_remove_from_queue {}
        } else {
            ns_log "Error" "acs-messaging: Error processing queue: $errMsg"
        }
    }
Generic XQL file:
<fullquery name="acs_messaging_process_queue.acs_message_remove_from_queue">
    <querytext>
      
                delete from acs_messages_outgoing
                    where message_id = :sending_message_id
                        and to_address = :recip_email
            
      </querytext>
</fullquery>

<fullquery name="acs_messaging_process_queue.acs_message_send">
    <querytext>
        select o.message_id as sending_message_id,
               o.to_address as recip_email,
               p.email as sender_email,
               to_char(m.sent_date, 'Dy, DD Mon YYYY HH24:MI:SS') as sent_date,
               m.rfc822_id,
               m.title,
               m.mime_type,
               m.content,
               m2.rfc822_id as in_reply_to
            from acs_messages_outgoing o,
                 acs_messages_all m left outer join acs_messages_all m2 on (m2.message_id = m.reply_to),
                 parties p
            where o.message_id = m.message_id
                and p.party_id = m.sender
                and wait_until <= current_timestamp
      </querytext>
</fullquery>
packages/acs-messaging/tcl/acs-messaging-procs.xql

PostgreSQL XQL file:
packages/acs-messaging/tcl/acs-messaging-procs-postgresql.xql

Oracle XQL file:
packages/acs-messaging/tcl/acs-messaging-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: