Is it possible to send an email to customers by order depending on the week days in WooCommerce?
For example: If some make order on Monday, Tuesday and Wednesday then the first email is send.
else if some make order Thursday, Friday and Saturday then the second email will be send.
(updated) – First you need to find the current day of the week using php function
date()
this way:Then we need to define the days for first email action and for 2nd email action storing this days in an array:
Now we need to compare the current day
$today
with$days1
and **$days
**2 to make an action:Now, for example, we can use the hook of this answer to your question combining the previous with it, this way:
You can use on of this hooks too depending on your needs, and you can even combine them together:
NOTE: All this code goes on
function.php
file of your active child theme or theme