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 2 months ago.
Improve this questionI'm looking for a way to delay the auto response (mail_2) from Contact Form 7 for 2 days. But I have no clue how to tackle it. I hope you have an idea.
I'm using the following code in functions.php
add_action( 'wpcf7_before_send_mail', 'send_custom_respond' );
function send_custom_respond($WPCF7_ContactForm) {
$submission = WPCF7_Submission::get_instance();
$posted_data = $submission->get_posted_data();
$contact_name = $posted_data['your-name'];
$contact_email = $posted_data['your-email'];
$mail_2 = $WPCF7_ContactForm->prop('mail_2') ;
$mail_2['subject'] = "Enjoying the trial?";
$mail_2['body'] = "Hi ". $contact_name . ",\n how's the trial? Let us know if you need some assistance.";
$WPCF7_ContactForm->set_properties(array("mail_2" => $mail_2));
return $WPCF7_ContactForm;
}
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 2 months ago.
Improve this questionI'm looking for a way to delay the auto response (mail_2) from Contact Form 7 for 2 days. But I have no clue how to tackle it. I hope you have an idea.
I'm using the following code in functions.php
add_action( 'wpcf7_before_send_mail', 'send_custom_respond' );
function send_custom_respond($WPCF7_ContactForm) {
$submission = WPCF7_Submission::get_instance();
$posted_data = $submission->get_posted_data();
$contact_name = $posted_data['your-name'];
$contact_email = $posted_data['your-email'];
$mail_2 = $WPCF7_ContactForm->prop('mail_2') ;
$mail_2['subject'] = "Enjoying the trial?";
$mail_2['body'] = "Hi ". $contact_name . ",\n how's the trial? Let us know if you need some assistance.";
$WPCF7_ContactForm->set_properties(array("mail_2" => $mail_2));
return $WPCF7_ContactForm;
}
I needed this functionality a few weeks back, found a few of these threads which helped a bit but ultimately wasn't exactly what I needed, then found a few plugins already in the directory that did the trick.
This one seemed to do the trick, but there are others you can try: https://wordpress.org/plugins/delayed-notifications-for-contact-form-7/