Esempio n. 1
0
function um_confirm_withdraw_email_user($id)
{
    if (!$id) {
        return;
    }
    global $wpdb;
    $table_name = $wpdb->prefix . 'um_withdraw';
    $check = $wpdb->get_row("SELECT * FROM {$table_name} WHERE id='" . $id . "'");
    if ($check) {
        $uid = $check->user_id;
        $num = $check->money;
        $balance = $check->balance;
        $balance_before = $num + $balance;
        $time = $check->time;
        $status = $check->status == 1 ? '已支付' : '处理中';
        $blogname = get_bloginfo('name');
        $bloghome = get_bloginfo('url');
        $admin_email = get_bloginfo('admin_email');
        $user_email = get_userdata($uid)->user_email;
        $user_name = get_userdata($uid)->display_name;
        $alipay_account = get_userdata($uid)->um_alipay_email;
        $user_ucenter_url = um_get_user_url('affiliate', $uid);
        $title = '推广提现请求处理通知';
        $wp_email = 'no-reply@' . preg_replace('#^www\\.#', '', strtolower($_SERVER['SERVER_NAME']));
        $fr = "From: \"" . $blogname . "\" <{$wp_email}>";
        $headers = "{$fr}\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n";
        $content = '<p><strong>亲爱的会员' . $user_name . ' 您好:</strong></p><p>您于' . $time . '在' . $blogname . '( <a target="_blank" href="' . $bloghome . '">' . $bloghome . '</a>)发起一笔推广提现请求,现在管理员已确认处理,以下是您的请求信息,您可进入个人中心-“<a target="_blank" href="' . $user_ucenter_url . '">我的推广</a>”页面查看详细内容,同时留意在本站提供的支付账号等的余额变动,如有任何疑问,请及时联系我们(Email:<a href="mailto:' . $admin_email . '" target="_blank">' . $admin_email . '</a>)。</p>';
        $content .= '<div style="background-color:#fefcc9; padding:10px 15px; border:1px solid #f7dfa4; font-size: 12px;line-height:160%;">申请人:<a href="' . $user_ucenter_url . '" title="用户个人中心" target="_blank">' . $user_name . '</a><br>支付宝账号:' . $alipay_account . '元<br>推广余额:' . $balance_before . '元<br>申请提现:' . $num . '元<br>提现后余额:' . $balance . '<br>发起时间:' . $time . '<br>请求状态:' . $status . '</div>';
        $html = store_email_template_wrap('', $content);
        wp_mail($user_email, $title, $html, $headers);
    }
    return;
}
Esempio n. 2
0
function add_user_credits_by_order($money, $user_id, $user_name, $from, $to)
{
    date_default_timezone_set('Asia/Shanghai');
    $ratio = ot_get_option('tin_cash_credit_ratio', 50);
    $credits = (int) ($ratio * $money);
    $admin_email = get_bloginfo('admin_email');
    $blogname = get_bloginfo('name');
    // add credits and msg
    update_tin_credit($user_id, $credits, 'add', 'tin_credit', sprintf(__('充值积分%1$s,花费%2$s元', 'tinection'), $credits, $money));
    // email
    $content = '<p>您已成功充值了' . $credits . '积分,当前积分为:' . $new_credits . ',如有任何疑问,请及时联系我们(Email:<a href="mailto:' . $admin_email . '" target="_blank">' . $admin_email . '</a>)。</p>';
    $html = store_email_template_wrap($user_name, $content);
    if (empty($from)) {
        $wp_email = 'no-reply@' . preg_replace('#^www\\.#', '', strtolower($_SERVER['SERVER_NAME']));
    } else {
        $wp_email = $from;
    }
    $title = '会员状态变更提醒';
    $fr = "From: \"" . $blogname . "\" <{$wp_email}>";
    $headers = "{$fr}\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n";
    wp_mail($to, $title, $html, $headers);
}
Esempio n. 3
0
function um_manual_promotevip($user_id, $user_name, $to, $type = 1, $endTime)
{
    date_default_timezone_set('Asia/Shanghai');
    $admin_email = get_bloginfo('admin_email');
    $blogname = get_bloginfo('name');
    global $wpdb;
    $prefix = $wpdb->prefix;
    $table = $prefix . 'um_vip_users';
    $userInfo = $wpdb->get_row("select * from " . $table . " where user_id=" . $user_id);
    if (!$userInfo) {
        $wpdb->query("INSERT INTO {$table} (user_id,user_type,startTime,endTime) VALUES ('{$user_id}', '{$type}', NOW(),'{$endTime}')");
    } else {
        if (strtotime($endTime) > strtotime($userInfo->endTime) && time() > strtotime($userInfo->endTime)) {
            $wpdb->query("UPDATE {$table} SET user_type='{$type}', startTime=NOW(), endTime='{$endTime}' WHERE user_id='{$user_id}'");
        } elseif (strtotime($endTime) > strtotime($userInfo->endTime) && time() <= strtotime($userInfo->endTime)) {
            $wpdb->query("UPDATE {$table} SET user_type='{$type}', endTime='{$endTime}' WHERE user_id='{$user_id}'");
        }
    }
    //email
    $vip = $wpdb->get_row("select * from " . $table . " where user_id=" . $user_id);
    $content = '<p>系统管理员已为您成功开通或续费了会员,以下为当前会员信息,如有任何疑问,请及时联系我们(Email:<a href="mailto:' . $admin_email . '" target="_blank">' . $admin_email . '</a>)。</p><div style="background-color:#fefcc9; padding:10px 15px; border:1px solid #f7dfa4; font-size: 12px;line-height:160%;">会员状态:' . output_order_vipType($vip->user_type) . '<br>开通时间:' . $vip->startTime . '<br>到期时间:' . $vip->endTime . '</div>';
    $html = store_email_template_wrap($user_name, $content);
    $wp_email = 'no-reply@' . preg_replace('#^www\\.#', '', strtolower($_SERVER['SERVER_NAME']));
    $title = '会员状态变更提醒';
    $fr = "From: \"" . $blogname . "\" <{$wp_email}>";
    $headers = "{$fr}\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n";
    wp_mail($to, $title, $html, $headers);
}