PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

When Does gform_after_submission Fire?

  1. I have a client that would like to remove entries automatically from the database after the email notification is sent. I've found some support entries here that indicate the gform_after_submission() hook is what I want to hook into in order to remove those entries.

    However, the one wrinkle in this is that we are using the form to connect to PayPal, and the form is set up not to send admin notifications until after payment is sent.

    My question, then, is: Does the gform_after_submission() hook fire when the user hits the Submit button on the form, or does it fire after PayPal returns the user back to the client's website? I'm guessing that I shouldn't remove the entry until after PayPal returns the user back to the client's website, so I want to make sure I'm using the right hook.

    Thanks for any advice you can offer

    Posted 7 years ago on Sunday April 14, 2013 | Permalink
  2. It will remove the entry before you get an answer from PayPal. To test this, submit a form, and get redirected to PayPal. Now, close that window, and look in the admin for the entry. It is there. You will need to use a hook like gform_paypal_post_ipn:

    http://www.gravityhelp.com/documentation/page/Gform_paypal_post_ipn

    That is fired after the IPN response from PayPal. That would still require that the IPN response is received. In your case, if you closed the browser window, no IPN would be sent and the orphan entry would still exist in a 'processing' state.

    Posted 7 years ago on Thursday April 18, 2013 | Permalink
  3. Awesome. Thank you.

    The main concern is basically to remove entries after the payment goes through, in order to offer them some additional privacy (there are multiple admins on the site, and only one of them is supposed to see the payer's contact information).

    Posted 7 years ago on Thursday April 18, 2013 | Permalink
  4. You're welcome.

    Posted 7 years ago on Thursday April 18, 2013 | Permalink