douguazhi5966 2018-01-04 05:17
浏览 73

如果订单在48小时内购买时立即发送电子邮件PHP MYSQL

current scenario is as follows, I have my query to send an email regardless of time to be sent 48hrs before a booking is made. However my problem is that this email needs to be sent out if the booking is within 48hr timeframe of when purchased then the email should be sent straight away as well as the confirmation email etc. Here is the sql query as it stands

session_start();
global  $wpdb;

$start_time = strtotime('+48 hours');
$end_time   = strtotime('+50 hours');

///running Schedule to send out 48hrs before purchased ride
$hours_48   = $wpdb->get_results("SELECT id, order_id, vehicle_name, start_date_time FROM fcb_booking WHERE status='paid' AND notified_48_hour=0 AND start_date_time > " . $start_time . " AND start_date_time < " . $end_time . " GROUP BY order_id ORDER BY start_date_time DESC");

Not sure how to add that if the time is within 48hrs of actual ride pickup time then send the email regardless but keep current functionality.

  • 写回答

1条回答 默认 最新

  • dongnai3960 2018-01-04 06:16
    关注

    add status in your table to toggle different status to decide when and which email to send and change the status once the email has been delivered

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号