function bid_notification_callback()
{
    $char = $_POST['ab_char'];
    $ret_url = $_POST['auc_url'] . $char . "ult_auc_id=" . $_POST['auction_id'];
    $adm_email = get_option("wdm_auction_email");
    $hdr = "";
    //$hdr  = "From: ". get_bloginfo('name') ." <". $adm_email ."> \r\n";
    $hdr .= "MIME-Version: 1.0\r\n";
    $hdr .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    wdm_ua_seller_notification_mail($adm_email, $_POST['md_bid'], $ret_url, $_POST['auc_name'], $_POST['auc_desc'], $_POST['ab_email'], $_POST['ab_name'], $hdr, '');
    wdm_ua_bidder_notification_mail($_POST['ab_email'], $_POST['ab_bid'], $ret_url, $_POST['auc_name'], $_POST['auc_desc'], $hdr, '');
    //outbid email
    global $wpdb;
    $wpdb->hide_errors();
    $prev_bid = get_post_meta($_POST['auction_id'], 'wdm_previous_bid_value', true);
    if (!empty($prev_bid) && $_POST['ab_bid'] > $prev_bid) {
        $bidder_email = "";
        $email_qry = "SELECT email FROM " . $wpdb->prefix . "wdm_bidders WHERE bid =" . $prev_bid . " AND auction_id =" . $_POST['auction_id'];
        $bidder_email = $wpdb->get_var($email_qry);
        if ($bidder_email != $_POST['ab_email']) {
            wdm_ua_outbid_notification_mail($bidder_email, $_POST['md_bid'], $ret_url, $_POST['auc_name'], $_POST['auc_desc'], $hdr, '');
        }
    }
    //auction won immediately
    if (isset($_POST['email_type']) && $_POST['email_type'] === 'winner_email') {
        //require_once('email-template.php');
        ultimate_auction_email_template($_POST['auc_name'], $_POST['auction_id'], $_POST['auc_desc'], round($_POST['md_bid'], 2), $_POST['ab_email'], $ret_url);
    }
    die;
}
示例#2
0
function wdm_proxy_bid_notification()
{
    $hdr = "";
    // $hdr  = "From: ". get_bloginfo('name') ." <". $adm_email ."> \r\n";
    $hdr .= "MIME-Version: 1.0\r\n";
    $hdr .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    if (function_exists('wdm_ua_seller_notification_mail')) {
        wdm_ua_seller_notification_mail($_POST['adm_email'], $_POST['mod_bid'], $_POST['ret_url'], $_POST['auc_name'], $_POST['auc_desc'], $_POST['mod_email'], $_POST['mod_name'], $hdr, '');
    }
    if (function_exists('wdm_ua_bidder_notification_mail')) {
        wdm_ua_bidder_notification_mail($_POST['orig_email'], $_POST['orig_bid'], $_POST['ret_url'], $_POST['auc_name'], $_POST['auc_desc'], $hdr, '');
    }
    if (function_exists('wdm_ua_outbid_notification_mail')) {
        wdm_ua_outbid_notification_mail($_POST['orig_email'], $_POST['mod_bid'], $_POST['ret_url'], $_POST['auc_name'], $_POST['auc_desc'], $hdr, '');
    }
    if ($_POST['stat'] === "Won") {
        if (function_exists('ultimate_auction_email_template')) {
            ultimate_auction_email_template($_POST['auc_name'], $_POST['auc_id'], $_POST['auc_desc'], $_POST['mod_bid'], $_POST['mod_email'], $_POST['ret_url']);
        }
    }
    die;
}