Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed last month.
Improve this questionI would like to ask if there is a way to automatically delay emails after completion?
I want these emails to arrive 1-2 hours later.
Is there a snippet of code for this?
Thank you!
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed last month.
Improve this questionI would like to ask if there is a way to automatically delay emails after completion?
I want these emails to arrive 1-2 hours later.
Is there a snippet of code for this?
Thank you!
I don't know CF7 well enough to give you specifics, but I think you'll need to
Alternatively depending on how you're sending emails you may be able to generate them on the initial form submission to be sent later, e.g. if you're sending them through Outlook.com or if your wp_mail hander has built-in retry and scheduling (as I'd guess WP Offload SES might?)
not tested but maybe you could simply use sleep using wpcf7_before_send_email
something like this:
add_action("wpcf7_before_send_mail", "wpcf7_pause_send");
function wpcf7_pause_send($cf7) {
sleep(3600);
}