Ejemplo n.º 1
0
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
$autoreply_queue = array();
//set_time_limit(10);
// find all the mail setting accounts to check.
foreach (module_ticket::get_accounts() as $account) {
    $updated_tickets = module_ticket::import_email($account['ticket_account_id']);
    if (is_array($updated_tickets)) {
        $autoreply_queue = array_merge($autoreply_queue, $updated_tickets);
    }
}
imap_errors();
//print_r($autoreply_queue);
module_cache::clear('ticket');
foreach ($autoreply_queue as $ticket_id) {
    ob_start();
    handle_hook('ticket_sidebar', $ticket_id);
    // to get envato hook working quicker
    ob_end_clean();
    // we have to send the email to admin notifying them about this ticket too.
    // if this latest email came from an admin user (ie: the user is replying to a customer via email)
    // then we don't send_admin_alert or autoreply, we just send reply back to customer.