function getAudience()
 {
     $status = MAILBEEZ_TRUSTPILOT_ORDER_STATUS_ID;
     // early check to avoid processing when email was already sent
     $mb_chk = new mailbeez_mailer($this);
     // MAILBEEZ_TRUSTPILOT_PASSED_DAYS
     // MAILBEEZ_TRUSTPILOT_PASSED_DAYS_SKIP
     $date_skip = $this->dbdate(MAILBEEZ_TRUSTPILOT_PASSED_DAYS_SKIP);
     $date_passed = $this->dbdate(MAILBEEZ_TRUSTPILOT_PASSED_DAYS);
     $query_raw = "select c.customers_firstname, c.customers_lastname, o.orders_id, o.customers_name,\n                        o.customers_id, o.customers_email_address, o.date_purchased, s.date_added as status_date\n                      from " . TABLE_ORDERS . " o\n                        left join " . TABLE_CUSTOMERS . " c\n                          on (o.customers_id = c.customers_id)\n                        left join " . TABLE_ORDERS_STATUS_HISTORY . " s\n                          on (o.orders_id = s.orders_id)\n                      where o.orders_status = s.orders_status_id\n                        and s.orders_status_id = '" . (int) $status . "'\n                        and s.date_added <= '" . $date_passed . "'\n                        and s.date_added > '" . $date_skip . "'\n                      order by o.orders_id DESC";
     $query = mh_db_query($query_raw);
     while ($item = mh_db_fetch_array($query)) {
         // mandatory fields:
         // - firstname
         // - lastname
         // - email_address
         // - customers-id -> block
         // other keys are replaced while sending: $<key>
         // early check to avoid processing when email was already sent
         $chk_result = $mb_chk->check($this->module, $this->iteration, $item['customers_id'], $item['orders_id']);
         if ($chk_result != false) {
             // this iteration was already sent -> skip
             continue;
         }
         $tp_block_token = base64_encode($mail['customers_id'] . '|' . $item['customers_email_address']);
         $tp_block_url = HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_HIVE . '?ma=block&m=' . $this->module . '&mp=' . $tp_block_token;
         $this->audience[$item['customers_id']] = array('firstname' => $item['customers_firstname'], 'lastname' => $item['customers_lastname'], 'customers_email_address' => $item['customers_email_address'], 'email_address' => MAILBEEZ_TRUSTPILOT_TRIGGER_EMAIL, 'customers_id' => $item['customers_id'], 'order_id' => $item['orders_id'], 'order_date' => mh_date_short($item['date_purchased']), 'status_date' => mh_date_short($item['status_date']), 'language' => MAILBEEZ_TRUSTPILOT_LANGUAGE, 'tp_block_url' => $tp_block_url);
     }
     return $this->audience;
 }
Exemplo n.º 2
0
echo MH_PLATFORM;
?>
)
<br>
<?php 
echo defined('PROJECT_VERSION') ? PROJECT_VERSION : '';
?>
<table>
    <tr>
        <td>Constant</td>
        <td>loaded value</td>
        <td>Database value</td>
    </tr>

<?php 
$configuration_query = mh_db_query("select configuration_key as cfgKey, configuration_value as cfgValue from " . TABLE_CONFIGURATION . " where configuration_key like 'MAILBEEZ%' order by configuration_key ");
while ($configuration = mh_db_fetch_array($configuration_query)) {
    ?>
        <tr bgcolor="<?php 
    echo constant($configuration['cfgKey']) !== $configuration['cfgValue'] ? '#f8933c' : '#abd37f';
    ?>
">
            <td style="word-wrap: normal"><?php 
    echo $configuration['cfgKey'];
    ?>
</td>
            <td><?php 
    echo constant($configuration['cfgKey']);
    ?>
</span></td>
            <td><?php