I was wondering if there was a way of delaying the auto responder function within notification settings? Would be great as I have a client who wants to portray that all emails are read within the hour.
Thanks
I was wondering if there was a way of delaying the auto responder function within notification settings? Would be great as I have a client who wants to portray that all emails are read within the hour.
Thanks
There is no way within the notification settings. Gravity Forms hands off the mail to wp_mail() immediately and it's sent out by the server immediately. You might be able to find a plugin which delays wp_mail() - I found this one but it looks pretty old http://wordpress.org/extend/plugins/wp-delayed-mail/
I'm not sure of another way to do it.
thanks for the quick response. will take a look and if i find a solution i'll come back in here and share :)
Please do. I am thinking about a way to catch and queue the notification, or not send notifications and then programmatically resend them with WP Cron or similar.
Just to say I also needed this functionality as I have used Gravity Forms as part of a booking system that captured the booking request then sent the user off-site to pay via RealEx. I only wanted the notifications to be triggered once the payment had been authorised even though the Gravity Form completed before sending the visitor to the payment gateway.
Basically I got around it by doing the following:
1) Created a separate table in the DB to store email notifications (but could be stored against the entry if required)
2) Using the GF hook: "gform_entry_created" I added the entry ID to the global $_POST array for retrieval later then added a new filter on wp_mail that captured the variables sent to wp_mail, stored them in the new database table (serialized) against the entry ID (fetched from $_POST) - 1 record created per notification email, and then blanked the array variables that are returned to wp_mail to stop it sending the emails.
3) Using the GF hook "gform_after_submission" I removed the filter from wp_mail so that it does not affect future emails sent out
4) When the gateway sent its response back to my site I grabbed all the stored emails for the particular entry ID from my BD table and manually called wp_mail() passing the variables - this was done in a loop as there were two notifications, Admin and User.
This worked like a charm for me but I did not need to manipulate the email notification at all so it was quite easy.
If you need example code then let me know.
MJ
Thanks for posting your solution MJ. Please do post the code at pastebin.com or pastie.org so we can point people to your solution.
No problem - I have stripped it out to the basics and commented where I feel applicable. You can find the code at: http://pastebin.com/1ZaJkVY4
Note - this can just be pasted into your functions file but I have used a custom database table (I have added the code to create the table if it doesn't exist already).
Hope it helps others.
MJ
Thank you MJ.